
*{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:1398px;height:1120px;
 transform-origin:center center;
 background:url("../assets/interface-revolution.png") center/1398px 1120px no-repeat;
 overflow:hidden;
}

/* boutons fonctionnels ajoutés sur les marges, sans autre image */
#backBtn,#sheetsBtn{
 position:absolute;left:18px;width:205px;border:5px solid #4d3925;border-radius:15px;
 color:#fff;text-decoration:none;text-align:center;font-weight:900;z-index:20;
 box-shadow:0 5px 0 #0005;text-shadow:0 2px #0008
}
#backBtn{top:20px;height:92px;padding:14px 8px;background:#17394d;font-size:20px}
#backBtn strong{font-size:31px;color:#ffc42c}
#sheetsBtn{top:132px;height:88px;padding:17px 6px;background:#267427;font-size:18px}

/* score en haut à droite, hors du cadre */
#scoreBox{
 position:absolute;right:20px;top:20px;width:190px;height:84px;z-index:20;
 background:#fffaf0;border:5px solid #4d3925;border-radius:16px;
 display:flex;align-items:center;justify-content:center;gap:12px;box-shadow:0 5px 0 #0004
}
#scoreBox>span{font-size:43px}
#scoreBox>div{display:flex;flex-direction:column;align-items:center}
#scoreBox b{font-size:18px;line-height:1}
#scoreBox strong{font-size:38px;line-height:1;color:#9b211d}

/* niveaux dans la marge gauche, sous les boutons */
#levels{
 position:absolute;left:18px;top:305px;width:205px;z-index:20;
 padding:10px;background:#173e56;border:5px solid #4d3925;border-radius:16px;box-shadow:0 5px 0 #0005
}
.levelsTitle{
 height:45px;margin-bottom:11px;border:3px solid #59401f;border-radius:11px;
 display:flex;align-items:center;justify-content:center;background:#17394d;
 color:#fff;font-size:22px;font-weight:900
}
.level{
 width:100%;height:62px;margin-bottom:11px;border:4px solid #59401f;border-radius:12px;
 background:linear-gradient(#82cd38,#4b9719);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 #ffd451;outline-offset:-8px}

/* pastilles juste au-dessus de la zone de questions, dans le cadre vierge */
#dots{
 position:absolute;left:310px;top:300px;width:820px;height:30px;z-index:20;
 display:flex;justify-content:center;align-items:center;gap:8px
}
.dot{width:20px;height:20px;border-radius:50%;background:#e7e2d8;border:2px solid #5a554c}
.dot.good{background:#31b85b;border-color:#176b31}
.dot.bad{background:#dc433a;border-color:#7b1915}
.dot.current{outline:3px solid #e4ae2e;outline-offset:2px}

/* le grand cadre blanc de l'image reste visible : aucune surcouche opaque inutile */
#board{
 position:absolute;left:275px;top:342px;width:870px;height:455px;z-index:15;
 padding:18px 36px;display:flex;flex-direction:column;align-items:center
}
#question{
 width:100%;min-height:86px;display:flex;align-items:center;justify-content:center;
 text-align:center;font-size:28px;line-height:1.18;font-weight:900;color:#242424
}
#answers{
 width:790px;display:grid;grid-template-columns:1fr 1fr;gap:16px 20px;margin-top:14px
}
.answer{
 min-height:72px;padding:10px 13px;border:3px solid #5a4a35;border-radius:12px;
 background:linear-gradient(#fffaf0,#ead9b5);color:#252525;font-size:19px;font-weight:800;
 box-shadow:0 4px 0 #8b7550;cursor:pointer
}
.answer.correct{background:#bde9c6;border-color:#2b8b49}
.answer.wrong{background:#f0bbb6;border-color:#b73b32}
.answer:disabled{opacity:1;cursor:default}
#feedback{height:34px;margin-top:14px;font-size:20px;font-weight:900}
#next,#replay{
 border:4px solid #59401f;border-radius:11px;background:#b88b37;color:#fff;
 font-size:18px;font-weight:900;padding:9px 18px;box-shadow:0 4px 0 #684d21;cursor:pointer
}
.hidden{display:none!important}
#end{
 position:absolute;left:275px;top:342px;width:870px;height:455px;z-index:30;
 display:flex;align-items:center;justify-content:center
}
#end section{
 width:500px;padding:30px;text-align:center;background:#fff7df;border:7px solid #5a452b;
 border-radius:20px;box-shadow:0 10px 30px #0006
}
#end h2{font-size:38px;margin:0 0 13px}#end p{font-size:25px;font-weight:900}

/* Boutons remplacés par les images fournies par l'utilisateur */
#backBtn,#sheetsBtn{
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  font-size:0 !important;
  color:transparent !important;
  text-shadow:none !important;
  background-color:transparent !important;
  background-repeat:no-repeat !important;
  background-position:center !important;
  background-size:contain !important;
}
#backBtn{
  left:8px !important;
  top:10px !important;
  width:254px !important;
  height:100px !important;
  background-image:url("../assets/retour-aux-jeux.png") !important;
}
#sheetsBtn{
  left:8px !important;
  top:122px !important;
  width:254px !important;
  height:96px !important;
  background-image:url("../assets/fiches-pedagogiques.png") !important;
}

/* Retire définitivement le texte JEUX superposé : seul le visuel du bouton reste visible */
#backBtn{
  text-indent:-9999px !important;
  overflow:hidden !important;
  white-space:nowrap !important;
  line-height:0 !important;
}
#backBtn strong{display:none !important;}
#sheetsBtn{
  text-indent:-9999px !important;
  overflow:hidden !important;
  white-space:nowrap !important;
  line-height:0 !important;
}

/* ===== VERSION 3 NIVEAUX ===== */
#levels{height:auto!important;min-height:295px!important;padding-bottom:12px!important}
#levels .level{margin-bottom:10px!important}
#levels .level:last-child{margin-bottom:0!important}

/* Niveau 1 : exercices variés */
#board.mode-special{padding-bottom:70px!important}
#board.mode-special #answers{display:block!important}
.special-instruction{text-align:center;font-size:16px;font-weight:800;margin:0 0 8px;color:#6a512c}
.tf-wrap{display:flex;justify-content:center;gap:24px;margin-top:15px}
.tf-btn{width:230px;height:70px;border:3px solid #66553c;border-radius:13px;background:linear-gradient(#fffdf7,#eadfc9);font-size:22px;font-weight:900;box-shadow:0 4px 0 #8f8068;cursor:pointer}
.tf-btn.chosen{outline:4px solid #e1aa2c}.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:800px;display:grid;grid-template-columns:1fr 1fr;gap:9px 18px;margin:0 auto}
.match-card{min-height:50px;padding:7px;border:3px solid #66553c;border-radius:10px;background:linear-gradient(#fffdf7,#eadfc9);font-size:15px;font-weight:800;box-shadow:0 3px 0 #8f8068;cursor:pointer}
.match-card.selected{outline:4px solid #e1aa2c}.match-card.paired{background:#e5f1f7;border-color:#3a738f}
.sort-area{width:820px;display:grid;grid-template-columns:1fr 1fr;gap:9px 15px;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:95px;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:750px;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 #e1aa2c}
#specialCorrection{width:790px;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:230px;height:49px;border:4px solid #4f3a20;border-radius:11px;background:linear-gradient(#83c63d,#4b9120);color:#fff;font-size:17px;font-weight:900;box-shadow:0 4px 0 #3a2b18;cursor:pointer}
#specialAction.next-mode{background:linear-gradient(#2f7fba,#235f8d);border-color:#24485f}
#board.mode-special #next{display:none!important}
