
*{box-sizing:border-box}
html,body{
  margin:0;width:100%;height:100%;overflow:hidden;
  background:#292722;font-family:Arial,Helvetica,sans-serif;
}
#stage{
  position:absolute;left:50%;top:50%;
  width:1536px;height:1024px;
  transform-origin:center center;
  background:url("../assets/fond-crise-1930-vierge.png") center/1536px 1024px no-repeat;
  overflow:hidden;
}

/* Boutons */
#backBtn,#sheetsBtn{
  position:absolute;left:12px;width:254px;
  background-repeat:no-repeat;background-size:contain;background-position:center;
  z-index:30;
}
#backBtn{
  top:12px;height:100px;
  background-image:url("../assets/retour-aux-jeux.png");
}
#sheetsBtn{
  top:120px;height:96px;
  background-image:url("../assets/fiches-pedagogiques.png");
}

/* Titre */
#titleBox{
  position:absolute;left:300px;top:18px;
  width:900px;height:170px;z-index:20;
  background:#263747;
  border:7px solid #4b3826;
  border-radius:24px;
  box-shadow:0 6px 0 rgba(0,0,0,.35);
  text-align:center;padding:18px 24px;
}
.title{
  color:#f4d99b;
  font:900 52px Georgia,serif;
  letter-spacing:1px;
  text-shadow:3px 3px #000;
}
.subtitle{
  margin:12px auto 0;
  width:760px;
  padding:9px 14px;
  background:#87352c;
  border:4px solid #c79545;
  border-radius:8px;
  color:#fff;
  font:italic 700 23px Georgia,serif;
}

/* Score en haut à droite */
#scoreBox{
  position:absolute;right:20px;top:18px;
  width:205px;height:88px;z-index:30;
  background:#fff;
  border:5px solid #43515a;
  border-radius:16px;
  box-shadow:0 5px 0 rgba(0,0,0,.30);
  display:flex;align-items:center;justify-content:center;
  gap:13px;
}
.trophy{font-size:44px}
#scoreBox>div{display:flex;flex-direction:column;align-items:center}
.scoreLabel{font-size:18px;font-weight:900;line-height:1}
#score{font-size:40px;font-weight:900;line-height:1;color:#111}

/* Niveaux à gauche, bien sous les boutons */
#levels{
  position:absolute;left:18px;top:300px;
  width:210px;z-index:25;
  padding:10px;
  background:#243c50;
  border:5px solid #4c3825;
  border-radius:16px;
  box-shadow:0 5px 0 rgba(0,0,0,.35);
}
.levelsTitle{
  height:46px;margin-bottom:11px;
  display:flex;align-items:center;justify-content:center;
  border:4px solid #5b4026;border-radius:11px;
  background:#203747;color:#fff;
  font-size:22px;font-weight:900;
}
.level{
  width:100%;height:62px;margin-bottom:10px;
  border:4px solid #59401f;border-radius:12px;
  background:linear-gradient(#84c43e,#4c8f21);
  color:#fff;font-size:21px;font-weight:900;
  text-shadow:0 2px #0008;box-shadow:0 4px 0 #332510;
  cursor:pointer;
}
.level:last-child{margin-bottom:0}
.level.active{
  outline:4px solid #f2c74a;
  outline-offset:-8px;
}

/* Pastilles, juste au-dessus du cadre de questions */
#dots{
  position:absolute;
  left:300px;top:225px;
  width:900px;height:32px;
  z-index:22;
  display:flex;align-items:center;justify-content:center;
  gap:8px;
}
.dot{
  width:20px;height:20px;border-radius:50%;
  background:#e6e3dd;border:2px solid #575757;
}
.dot.good{background:#2fb95b;border-color:#176b31}
.dot.bad{background:#dd433b;border-color:#7d1915}
.dot.current{outline:3px solid #e3b134;outline-offset:2px}

/* Zone de travail calée DANS le grand cadre vierge de l'image */
#board{
  position:absolute;
  left:255px;top:270px;
  width:1020px;height:500px;
  z-index:20;
  background:transparent;
  padding:36px 55px 22px;
  display:flex;flex-direction:column;
  align-items:center;
}
#question{
  width:100%;
  min-height:92px;
  display:flex;align-items:center;justify-content:center;
  text-align:center;
  color:#1f2b32;
  font-size:29px;
  line-height:1.18;
  font-weight:900;
}
#answers{
  width:880px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px 22px;
  margin-top:18px;
}
.answer{
  min-height:76px;
  padding:11px 14px;
  border:4px solid #51585a;
  border-radius:14px;
  background:linear-gradient(#fffef9,#e9e1d0);
  color:#222;
  font-size:20px;
  font-weight:800;
  box-shadow:0 5px 0 #8f8676;
  cursor:pointer;
}
.answer:hover{transform:translateY(-1px)}
.answer:disabled{opacity:1;cursor:default;transform:none}
.answer.correct{background:#bde9c6;border-color:#2b8b49}
.answer.wrong{background:#f0bbb6;border-color:#b73b32}

#feedback{
  height:38px;
  margin-top:16px;
  font-size:21px;
  font-weight:900;
  text-align:center;
}
#next,#replay{
  border:4px solid #4b3925;
  border-radius:12px;
  background:#9b7435;
  color:#fff;
  font-size:18px;
  font-weight:900;
  padding:9px 18px;
  box-shadow:0 4px 0 #5e4727;
  cursor:pointer;
}
#next{margin-top:2px}
.hidden{display:none!important}

/* Fin */
#end{
  position:absolute;
  left:255px;top:270px;
  width:1020px;height:500px;
  z-index:40;
  display:flex;align-items:center;justify-content:center;
}
#end section{
  width:540px;
  padding:36px;
  text-align:center;
  background:#fff8e8;
  border:7px solid #4b3925;
  border-radius:20px;
  box-shadow:0 10px 30px #0006;
}
#end h2{font-size:40px;margin:0 0 14px}
#end p{font-size:26px;font-weight:900}

/* ===== 3 NIVEAUX ===== */
#levels{height:300px}
#levels .level{height:62px;margin-bottom:10px}

/* Niveau 1 varié */
#board.mode-special{padding:20px 55px 72px}
#board.mode-special #question{min-height:78px;font-size:27px}
#board.mode-special #answers{display:block;width:880px;margin-top:2px}
.special-instruction{text-align:center;font-size:16px;font-weight:800;color:#6c5837;margin:0 0 8px}
.tf-wrap{display:flex;justify-content:center;gap:26px;margin-top:18px}
.tf-btn{width:240px;height:72px;border:4px solid #51585a;border-radius:14px;background:linear-gradient(#fffef9,#e9e1d0);font-size:22px;font-weight:900;box-shadow:0 5px 0 #8f8676;cursor:pointer}
.tf-btn.chosen{outline:4px solid #e3b134}.tf-btn.correct,.match-card.correct{background:#bde9c6;border-color:#2b8b49}.tf-btn.wrong,.match-card.bad-pair{background:#f0bbb6;border-color:#b73b32}
.match-grid{width:820px;display:grid;grid-template-columns:1fr 1fr;gap:9px 18px;margin:0 auto}
.match-card{min-height:50px;padding:7px;border:3px solid #51585a;border-radius:11px;background:linear-gradient(#fffef9,#e9e1d0);font-size:15px;font-weight:800;box-shadow:0 3px 0 #8f8676;cursor:pointer}
.match-card.selected{outline:4px solid #e3b134}.match-card.paired{background:#e5f1f7;border-color:#3a738f}
.sort-area{width:830px;display:grid;grid-template-columns:1fr 1fr;gap:9px 16px;margin:0 auto}
.sort-bank{grid-column:1/3;min-height:50px;display:flex;gap:6px;flex-wrap:wrap;justify-content:center}
.drag-card{padding:7px 10px;background:#fffaf0;border:3px solid #715a35;border-radius:9px;font-size:14px;font-weight:900;cursor:grab;box-shadow:0 3px 0 #8f8068}
.drop-zone{min-height:100px;padding:6px;border:3px dashed #8a7049;border-radius:12px;background:#fff9e8cc;text-align:center}
.drop-zone h3{margin:0 0 5px;font-size:16px}.drop-zone .items{display:flex;gap:5px;flex-wrap:wrap;justify-content:center}
.drag-card.correct-card,.order-card.correct-card{background:#bde9c6;border-color:#2b8b49}.drag-card.wrong-card,.order-card.wrong-card{background:#f0bbb6;border-color:#b73b32}
.order-wrap{width:760px;display:flex;flex-direction:column;gap:7px;margin:3px auto}
.order-card{padding:8px;background:#fffaf0;border:3px solid #715a35;border-radius:10px;font-size:15px;font-weight:800;text-align:center;cursor:pointer;box-shadow:0 3px 0 #8f8068}
.order-card.selected{outline:4px solid #e3b134}
#specialCorrection{width:810px;max-height:58px;overflow:auto;margin:7px auto 0;padding:6px 10px;border:2px solid #2c617c;border-radius:10px;background:#eef7fb;color:#17384b;font-size:13px;line-height:1.15;font-weight:800;text-align:center}
#specialAction{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);width:235px;height:49px;border:4px solid #4b3925;border-radius:12px;background:#9b7435;color:#fff;font-size:17px;font-weight:900;box-shadow:0 4px 0 #5e4727;cursor:pointer}
#specialAction.next-mode{background:#2f7199}
#board.mode-special #next{display:none!important}
