
*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#241b12;font-family:Arial,Helvetica,sans-serif}
#stage{position:absolute;left:50%;top:50%;width:1536px;height:1024px;transform-origin:center;background:url("../assets/fond-seigneurs-chevaliers.png") center/1536px 1024px no-repeat;overflow:hidden}
#backBtn{position:absolute;left:16px;top:18px;width:215px;height:88px;z-index:60}
#sheetsBtn{position:absolute;left:16px;top:118px;width:215px;height:88px;z-index:60}
#scoreBox{position:absolute;right:26px;top:26px;width:190px;height:88px;z-index:55;background:#fff;border:5px solid #43515a;border-radius:16px;display:flex;align-items:center;justify-content:center;gap:10px;box-shadow:0 5px 0 #0004}
#scoreBox span{font-size:42px}#scoreBox div{display:flex;flex-direction:column;align-items:center}#scoreBox b{font-size:18px}#scoreBox strong{font-size:39px;line-height:1}
#levels{position:absolute;left:22px;top:260px;width:210px;z-index:55;padding:10px;background:#17394d;border:5px solid #6b4b24;border-radius:17px;box-shadow:0 5px 0 #0005}
.levelsTitle{height:46px;margin-bottom:11px;background:#17394d;border:3px solid #b7883e;border-radius:10px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:22px;font-weight:900}
.level{width:100%;height:66px;margin-bottom:11px;border:4px solid #6b4b24;border-radius:13px;background:linear-gradient(#83c63d,#4b9120);color:#fff;font-size:21px;font-weight:900;cursor:pointer}
.level:last-child{margin-bottom:0}.level.active{outline:4px solid #f1c34a;outline-offset:-8px}
#dots{position:absolute;left:345px;top:190px;width:860px;height:38px;z-index:55;display:flex;align-items:center;justify-content:center;gap:8px}
.dot{width:20px;height:20px;border-radius:50%;background:#eee9df;border:2px solid #56514a}.dot.good{background:#31b85b;border-color:#176b31}.dot.bad{background:#dc433a;border-color:#7b1915}.dot.current{outline:3px solid #e1aa2c;outline-offset:2px}
#board{position:absolute;left:280px;top:235px;width:1040px;height:650px;z-index:50;background:transparent;border:0;padding:24px 58px;display:flex;flex-direction:column;align-items:center}
#question{width:100%;min-height:120px;display:flex;align-items:center;justify-content:center;text-align:center;font-size:31px;line-height:1.18;font-weight:900;color:#24303a;padding:0 20px}
#answers{width:860px;display:grid;grid-template-columns:1fr 1fr;gap:20px 28px;margin-top:16px}
.answer{min-height:86px;padding:12px 14px;border:3px solid #715a35;border-radius:13px;background:linear-gradient(#fffdf7,#eadfc9);font-size:20px;font-weight:800;color:#222;box-shadow:0 5px 0 #8f8068;cursor:pointer}
.answer.correct{background:#bde9c6;border-color:#2b8b49}.answer.wrong{background:#f0bbb6;border-color:#b73b32}.answer:disabled{opacity:1;cursor:default}
#feedback{height:40px;margin-top:17px;font-size:21px;font-weight:900;text-align:center}
#next,#replay{border:4px solid #6b4b24;border-radius:11px;background:#9d7535;color:#fff;font-size:18px;font-weight:900;padding:9px 18px;cursor:pointer}
.hidden{display:none!important}
#end{position:absolute;left:280px;top:235px;width:1040px;height:650px;z-index:70;display:flex;align-items:center;justify-content:center}
#end section{width:500px;padding:34px;text-align:center;background:#fff8e8;border:6px solid #6b4b24;border-radius:18px;box-shadow:0 10px 30px #0006}
#end h2{font-size:38px;margin:0 0 12px}#end p{font-size:25px;font-weight:900}

/* Niveau 1 : exercices variés */
#board.mode-special{padding-top:18px}
.special-instruction{font-size:18px;font-weight:800;color:#6a512c;text-align:center;margin:-6px 0 10px}
.tf-wrap{display:flex;gap:28px;justify-content:center;margin-top:22px}
.tf-btn{width:250px;height:95px;border:4px solid #715a35;border-radius:16px;background:linear-gradient(#fffdf7,#eadfc9);font-size:27px;font-weight:900;box-shadow:0 6px 0 #8f8068;cursor:pointer}
.tf-btn.correct,.match-card.correct{background:#bde9c6;border-color:#2b8b49}
.tf-btn.wrong,.match-card.wrong{background:#f0bbb6;border-color:#b73b32}
.match-grid{width:850px;display:grid;grid-template-columns:1fr 1fr;gap:18px 28px;margin-top:12px}
.match-card{min-height:72px;border:3px solid #715a35;border-radius:13px;background:linear-gradient(#fffdf7,#eadfc9);font-size:19px;font-weight:850;box-shadow:0 5px 0 #8f8068;cursor:pointer;padding:10px}
.match-card.selected{outline:5px solid #e1aa2c}
.sort-area{width:870px;display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:6px}
.sort-bank{grid-column:1/3;display:flex;gap:10px;justify-content:center;flex-wrap:wrap;min-height:82px}
.drag-card{padding:13px 18px;background:#fffaf0;border:3px solid #715a35;border-radius:12px;font-size:18px;font-weight:900;cursor:grab;box-shadow:0 4px 0 #8f8068}
.drop-zone{min-height:145px;border:4px dashed #8a7049;border-radius:16px;background:#fff9e8aa;padding:10px;text-align:center}
.drop-zone h3{margin:0 0 8px;font-size:21px}.drop-zone .items{display:flex;gap:7px;flex-wrap:wrap;justify-content:center}
.drop-zone.goodflash{background:#ccefd3}.drop-zone.badflash{background:#f3c3be}
.order-wrap{width:820px;display:flex;flex-direction:column;gap:10px;margin-top:5px}
.order-card{padding:13px;background:#fffaf0;border:3px solid #715a35;border-radius:12px;font-size:18px;font-weight:850;cursor:pointer;text-align:center;box-shadow:0 4px 0 #8f8068}
.order-card.selected{outline:5px solid #e1aa2c}
#checkSpecial{margin-top:16px}


/* === RECENTRAGE NIVEAU 1 === */
#board.mode-special{
  left: 300px !important;
  width: 980px !important;
  padding-left: 40px !important;
  padding-right: 40px !important;
  align-items: center !important;
}

#board.mode-special #question{
  width: 100% !important;
  text-align: center !important;
  justify-content: center !important;
  padding: 0 30px !important;
}

#board.mode-special #answers{
  width: 900px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

#board.mode-special .special-instruction{
  width: 100% !important;
  text-align: center !important;
  margin: 0 0 14px !important;
}

#board.mode-special .sort-area{
  width: 860px !important;
  margin: 0 auto !important;
  grid-template-columns: 1fr 1fr !important;
  column-gap: 24px !important;
  row-gap: 18px !important;
}

#board.mode-special .sort-bank{
  grid-column: 1 / 3 !important;
  width: 100% !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 auto 4px !important;
}

#board.mode-special .drop-zone{
  width: 100% !important;
  min-height: 150px !important;
  margin: 0 !important;
}

#board.mode-special .match-grid,
#board.mode-special .order-wrap,
#board.mode-special .tf-wrap{
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Ajustement demandé : niveau 1, 30 px vers la gauche */
#board.mode-special{
  left: 270px !important;
}


/* =========================================================
   NIVEAU 1 : bouton VALIDER identique pour TOUS les exercices
   + zone de correction commune
   ========================================================= */
#board.mode-special #answers{
  display:block !important;
}

#specialActionBar{
  width:100%;
  display:flex;
  justify-content:center;
  align-items:center;
  margin-top:18px;
}

#checkSpecial{
  width:230px;
  min-height:58px;
  border:4px solid #4f3a20;
  border-radius:13px;
  background:linear-gradient(#83c63d,#4b9120);
  color:#fff;
  font-size:21px;
  font-weight:900;
  text-shadow:0 2px #0007;
  box-shadow:0 5px 0 #3a2b18;
  cursor:pointer;
}

#checkSpecial:hover{
  transform:translateY(-1px);
}

#checkSpecial:disabled{
  opacity:.65;
  cursor:default;
  transform:none;
}

#specialCorrection{
  width:860px;
  max-height:105px;
  overflow:auto;
  margin:14px auto 0;
  padding:10px 16px;
  border:3px solid #2c617c;
  border-radius:12px;
  background:#eef7fb;
  color:#17384b;
  font-size:18px;
  line-height:1.25;
  font-weight:800;
  text-align:center;
}

.tf-btn.chosen{
  outline:5px solid #e1aa2c;
  outline-offset:2px;
}

.drag-card{
  user-select:none;
}

.drag-card.in-zone{
  cursor:grab;
}

.drag-card.correct-card{
  background:#bde9c6 !important;
  border-color:#2b8b49 !important;
}

.drag-card.wrong-card{
  background:#f0bbb6 !important;
  border-color:#b73b32 !important;
}

.match-card.paired{
  background:#e5f1f7;
  border-color:#3a738f;
}

.match-card.bad-pair{
  background:#f0bbb6;
  border-color:#b73b32;
}

.order-card.correct-card{
  background:#bde9c6 !important;
  border-color:#2b8b49 !important;
}

.order-card.wrong-card{
  background:#f0bbb6 !important;
  border-color:#b73b32 !important;
}

/* Niveau 1 : VALIDER et QUESTION SUIVANTE occupent exactement la même place */
#board.mode-special #next{
  width:230px !important;
  min-height:58px !important;
  margin:18px auto 0 !important;
  border:4px solid #4f3a20 !important;
  border-radius:13px !important;
  background:linear-gradient(#83c63d,#4b9120) !important;
  color:#fff !important;
  font-size:19px !important;
  font-weight:900 !important;
  text-shadow:0 2px #0007 !important;
  box-shadow:0 5px 0 #3a2b18 !important;
}

/* Niveau 1 : un seul bouton d'action, même emplacement avant/après validation */
#board.mode-special #next{
  display:none !important;
}
#specialActionBar{
  min-height:64px !important;
}
#checkSpecial{
  display:block !important;
  margin:0 auto !important;
}
#checkSpecial.next-mode{
  background:linear-gradient(#2f7fba,#235f8d) !important;
  border-color:#24485f !important;
  box-shadow:0 5px 0 #183548 !important;
}


/* ==========================================================
   CORRECTION DÉFINITIVE :
   au niveau 1, un SEUL bouton permanent est utilisé.
   Il ne fait pas partie du contenu variable des exercices.
   ========================================================== */
#board.mode-special{
  position:absolute !important;
  padding-bottom:95px !important;
}

#board.mode-special #specialAction{
  display:block;
  position:absolute !important;
  left:50% !important;
  bottom:18px !important;
  transform:translateX(-50%) !important;
  width:230px !important;
  height:58px !important;
  margin:0 !important;
  padding:0 14px !important;

  border:4px solid #4f3a20 !important;
  border-radius:13px !important;
  background:linear-gradient(#83c63d,#4b9120) !important;
  color:#fff !important;
  font-size:20px !important;
  font-weight:900 !important;
  line-height:1.05 !important;
  text-align:center !important;
  text-shadow:0 2px #0007 !important;
  box-shadow:0 5px 0 #3a2b18 !important;
  cursor:pointer !important;
  z-index:100 !important;
}

#board.mode-special #specialAction.next-mode{
  background:linear-gradient(#2f7fba,#235f8d) !important;
  border-color:#24485f !important;
  box-shadow:0 5px 0 #183548 !important;
}

#board.mode-special #next{
  display:none !important;
}

/* On supprime visuellement toute ancienne barre/bouton éventuellement présent
   dans les variantes d'exercices précédentes. */
#board.mode-special #specialActionBar,
#board.mode-special #checkSpecial{
  display:none !important;
}

#board:not(.mode-special) #specialAction{
  display:none !important;
}

#specialCorrection{
  margin-bottom:6px !important;
}
