/* ═══════════════════════════════════════════════════════════
   LESSON.CSS — Académie Pirate
   Page Leçon : Héros animé + Contenu pédagogique
   Mobile-first — règle CS-04
   Préfixe .lesson- — pas de collision avec les autres CSS
   ═══════════════════════════════════════════════════════════ */

#lesson-overlay {
  position: fixed; inset: 0; z-index: 8500;
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; align-items: center;
  scroll-behavior: smooth;
}

.lesson-particles {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
}
.lesson-particle {
  position: absolute; border-radius: 50%; opacity: 0; bottom: -20px;
  animation: lesson-float linear infinite;
}
.lesson-particle-fire { border-radius: 50% 20% 50% 20%; animation-name: lesson-fire-float; }
@keyframes lesson-fire-float {
  0%   { transform: translateY(0) scale(1) rotate(0deg); opacity: .9; }
  50%  { transform: translateY(-40vh) scale(1.4) rotate(180deg); opacity: .6; }
  100% { transform: translateY(-90vh) scale(.4) rotate(360deg); opacity: 0; }
}
.lesson-particle-water { border-radius: 50%; animation-name: lesson-water-float; }
@keyframes lesson-water-float {
  0%   { transform: translateY(0) translateX(0); opacity: .8; }
  50%  { transform: translateY(-45vh) translateX(12px); opacity: .5; }
  100% { transform: translateY(-90vh) translateX(-5px); opacity: 0; }
}
.lesson-particle-energy { clip-path: polygon(50% 0%,0% 100%,100% 100%); animation-name: lesson-energy-float; }
@keyframes lesson-energy-float {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  50%  { transform: translateY(-50vh) rotate(180deg); opacity: .6; }
  100% { transform: translateY(-95vh) rotate(360deg); opacity: 0; }
}
.lesson-particle-sword { width:3px !important; height:20px !important; border-radius:2px; animation-name: lesson-sword-float; }
@keyframes lesson-sword-float {
  0%   { transform: translateY(0) rotate(45deg); opacity: .8; }
  50%  { transform: translateY(-45vh) rotate(225deg); opacity: .5; }
  100% { transform: translateY(-90vh) rotate(405deg); opacity: 0; }
}

/* ── PANNEAU HÉROS ── */
.lesson-hero-panel {
  position: relative; width: 100%; min-height: 55vh;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; overflow: hidden; padding: 24px 16px 16px;
  transition: opacity .4s ease;
}
.lesson-hero-inner {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: clamp(16px,4vw,32px);
  width: 100%; max-width: 600px; flex-wrap: wrap; justify-content: center;
}
.lesson-hero-img-wrap { position: relative; flex-shrink: 0; width: clamp(120px,30vw,180px); height: clamp(160px,40vw,240px); }
.lesson-hero-aura { position: absolute; inset: -20px; border-radius: 50%; z-index: 0; animation: lesson-aura-pulse 2s ease-in-out infinite; }
@keyframes lesson-aura-pulse { 0%,100%{transform:scale(1);opacity:.8;} 50%{transform:scale(1.15);opacity:1;} }
.lesson-hero-img {
  position: relative; z-index: 1; width: 100%; height: 100%;
  object-fit: cover; object-position: top; border-radius: 16px;
  filter: drop-shadow(0 0 20px currentColor) saturate(1.3);
  animation: lesson-hero-appear .8s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes lesson-hero-appear { from{transform:scale(.5) translateY(40px);opacity:0;} to{transform:scale(1) translateY(0);opacity:1;} }
.lesson-hero-power-ring { position: absolute; inset: -12px; border-radius: 50%; border: 3px solid; z-index: 0; animation: lesson-ring-spin 4s linear infinite; }
.lesson-ring-2 { inset: -24px; border-width: 2px; border-style: dashed; animation-duration: 6s; animation-direction: reverse; }
@keyframes lesson-ring-spin { from{transform:rotate(0deg);} to{transform:rotate(360deg);} }
.lesson-hero-content { position: relative; z-index: 2; flex: 1; min-width: min(240px,80vw); }
.lesson-hero-name { font-family: "Bangers",cursive; font-size: clamp(1.4rem,5vw,2rem); letter-spacing: 3px; text-shadow: 2px 2px 0 #000; line-height: 1; animation: lesson-name-appear .6s ease .2s both; }
@keyframes lesson-name-appear { from{transform:translateX(-30px);opacity:0;} to{transform:translateX(0);opacity:1;} }
.lesson-hero-world { font-family: "Nunito",sans-serif; font-size: .8rem; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 12px; opacity: .85; }
.lesson-hero-bubble { position: relative; animation: lesson-bubble-appear .6s ease .4s both; }
@keyframes lesson-bubble-appear { from{transform:scale(.8) translateY(10px);opacity:0;} to{transform:scale(1) translateY(0);opacity:1;} }
.lesson-hero-bubble-inner { background: rgba(255,255,255,.95); border: 3px solid #000; border-radius: 16px 16px 16px 4px; padding: 12px 16px; box-shadow: 4px 4px 0 rgba(0,0,0,.5); }
.lesson-hero-quote { color: #1a1a2e; font-family: "Nunito",sans-serif; font-size: clamp(.82rem,2.5vw,1rem); font-weight: 800; line-height: 1.5; }
.lesson-hero-bar { width: 90%; max-width: 400px; height: 5px; background: rgba(255,255,255,.12); border-radius: 4px; margin-top: 20px; overflow: hidden; position: relative; z-index: 2; }
.lesson-hero-bar-fill { height: 100%; border-radius: 4px; width: 0%; transition: width .05s linear; }
.lesson-skip-hero-btn { position: relative; z-index: 3; margin-top: 12px; background: rgba(0,0,0,.4); border: 1px solid; border-radius: 20px; padding: 6px 18px; font-family: "Nunito",sans-serif; font-size: .75rem; font-weight: 800; cursor: pointer; transition: all .15s; -webkit-tap-highlight-color: transparent; }
.lesson-skip-hero-btn:hover { background: rgba(0,0,0,.6); transform: scale(1.05); }

/* ── PANNEAU CONTENU ── */
.lesson-content-panel { width: 100%; max-width: 680px; padding: 0 14px 80px; }
.lesson-content-inner { display: flex; flex-direction: column; gap: 16px; }
.lesson-banner { border-radius: 18px; border: 2px solid; padding: 18px 18px 16px; margin-top: 8px; }
.lesson-banner-world { font-family: "Bangers",cursive; font-size: .85rem; letter-spacing: 2px; margin-bottom: 6px; opacity: .9; }
.lesson-rule-title { font-family: "Nunito",sans-serif; font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 2px; color: rgba(255,255,255,.6); margin-bottom: 8px; }
.lesson-rule-text { font-family: "Nunito",sans-serif; font-size: clamp(.9rem,2.5vw,1.05rem); font-weight: 800; line-height: 1.6; color: #fff; }
.lesson-section { background: rgba(255,255,255,.04); border: 2px solid var(--sec-color,rgba(255,255,255,.12)); border-radius: 16px; overflow: hidden; animation: lesson-sec-enter .5s ease both; }
@keyframes lesson-sec-enter { from{transform:translateY(16px);opacity:0;} to{transform:translateY(0);opacity:1;} }
.lesson-section:nth-child(1){animation-delay:.1s;} .lesson-section:nth-child(2){animation-delay:.2s;} .lesson-section:nth-child(3){animation-delay:.3s;}
.lesson-sec-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px 10px; background: linear-gradient(135deg,var(--sec-color,#333) 0%,transparent 100%); border-bottom: 1px solid rgba(255,255,255,.08); }
.lesson-sec-icon { font-size: 1.2rem; flex-shrink: 0; }
.lesson-sec-title { font-family: "Bangers",cursive; font-size: 1.1rem; letter-spacing: 2px; color: #fff; text-shadow: 1px 1px 0 #000; }
.lesson-examples { list-style: none; padding: 12px 16px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.lesson-example { font-family: "Nunito",sans-serif; font-size: clamp(.82rem,2.2vw,.92rem); font-weight: 700; line-height: 1.6; color: rgba(255,255,255,.9); padding: 8px 12px; background: rgba(255,255,255,.04); border-radius: 10px; border-left: 3px solid var(--sec-color,rgba(255,255,255,.2)); }
.lesson-example strong { color: #fff; }
.lesson-hero-tip { border-radius: 14px; border: 2px solid; padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; }
.lesson-tip-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }
.lesson-tip-text { font-family: "Nunito",sans-serif; font-size: clamp(.82rem,2.2vw,.92rem); font-weight: 800; line-height: 1.6; color: rgba(255,255,255,.95); }

/* ── ÉCHAUFFEMENT ── */
.lesson-warmup { margin-top: 4px; }
.lesson-warmup-title { font-family: "Bangers",cursive; font-size: 1.3rem; letter-spacing: 3px; text-shadow: 2px 2px 0 #000; margin-bottom: 4px; }
.lesson-warmup-sub { font-family: "Nunito",sans-serif; font-size: .78rem; font-weight: 800; color: rgba(255,255,255,.5); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
.lesson-warmup-card { background: rgba(255,255,255,.04); border: 2px solid rgba(255,255,255,.1); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.lesson-warmup-q { font-family: "Nunito",sans-serif; font-size: clamp(.88rem,2.5vw,1rem); font-weight: 800; color: #fff; margin-bottom: 10px; line-height: 1.5; }
.lesson-warmup-opts { display: flex; flex-direction: column; gap: 7px; }
.lesson-warmup-opt { width: 100%; padding: 10px 14px; text-align: left; background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.1); border-radius: 10px; color: #fff; cursor: pointer; font-family: "Nunito",sans-serif; font-size: clamp(.82rem,2vw,.92rem); font-weight: 700; transition: all .15s; -webkit-tap-highlight-color: transparent; }
.lesson-warmup-opt:hover:not(:disabled) { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); }
.lesson-warmup-opt:disabled { cursor: default; }
.lesson-warmup-opt.lwu-correct { background: rgba(6,214,160,.2) !important; border-color: #06d6a0 !important; }
.lesson-warmup-opt.lwu-wrong   { background: rgba(239,68,68,.2) !important; border-color: #ef4444 !important; }
.lesson-warmup-fb { display: none; margin-top: 8px; padding: 6px 12px; border-radius: 8px; font-family: "Nunito",sans-serif; font-size: .82rem; font-weight: 800; }
.lwu-fb-ok { display: block !important; background: rgba(6,214,160,.2); border: 1px solid rgba(6,214,160,.5); color: #06d6a0; }
.lwu-fb-ko { display: block !important; background: rgba(239,68,68,.2); border: 1px solid rgba(239,68,68,.5); color: #ef4444; }

/* ── BOUTON QUIZ ── */
.lesson-start-wrap { text-align: center; padding: 20px 0 10px; }
.lesson-start-btn { width: 100%; max-width: 400px; padding: 16px 28px; border: none; border-radius: 16px; cursor: pointer; font-family: "Bangers",cursive; font-size: clamp(1.1rem,4vw,1.3rem); letter-spacing: 2px; color: #fff; transition: transform .15s,box-shadow .15s; -webkit-tap-highlight-color: transparent; animation: lesson-btn-pulse 2s ease-in-out infinite; display: block; margin: 0 auto; }
@keyframes lesson-btn-pulse { 0%,100%{transform:scale(1);} 50%{transform:scale(1.03);} }
.lesson-start-btn:hover  { transform: scale(1.05) translateY(-2px); }
.lesson-start-btn:active { transform: scale(.97); }

@media(min-width:600px){ .lesson-hero-inner{flex-wrap:nowrap;justify-content:flex-start;} .lesson-hero-img-wrap{width:200px;height:270px;} }
@media(max-width:380px){ .lesson-hero-panel{min-height:50vh;padding:16px 12px 12px;} .lesson-hero-quote{font-size:.78rem;} .lesson-warmup-opt{font-size:.78rem;padding:8px 10px;} }