
*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#2f302c;font-family:Arial,Helvetica,sans-serif}
#stage{
  position:absolute;left:50%;top:50%;
  width:1536px;height:1024px;
  transform-origin:center center;
  background:url("../assets/interface-14-18.png") 0 0/1536px 1024px no-repeat;
  overflow:hidden;
}
#backBtn{position:absolute;left:7px;top:18px;width:270px;height:112px;z-index:5}
#sheetsBtn{position:absolute;left:7px;top:155px;width:270px;height:108px;z-index:5}
#scoreBox{
  position:absolute;right:32px;top:28px;width:220px;height:96px;
  border:4px solid #3e4344;border-radius:16px;background:#fff;
  display:flex;align-items:center;justify-content:center;gap:14px;
  box-shadow:0 5px 0 #0004;z-index:6;color:#20282d;font-weight:900;
}
#scoreBox>span{font-size:50px}
#scoreBox>div{display:flex;flex-direction:column;align-items:center}
#scoreBox b{font-size:19px}
#scoreBox strong{font-size:42px;line-height:1}
#levels{
  position:absolute;left:38px;top:315px;width:215px;
  display:flex;flex-direction:column;gap:14px;z-index:6;
}
.levelBtn{
  height:72px;border:5px solid #4e371f;border-radius:16px;
  background:linear-gradient(#8d774f,#614c2e);color:#fff;
  font-size:23px;font-weight:900;text-shadow:0 2px 0 #0008;
  box-shadow:0 5px 0 #2d2013;cursor:pointer;
}
.levelBtn.active{outline:4px solid #d9c27c;outline-offset:-8px;filter:brightness(1.12)}
#dots{
  position:absolute;left:322px;top:320px;width:840px;height:28px;
  display:flex;justify-content:center;align-items:center;gap:8px;z-index:7;
}
.dot{
  width:20px;height:20px;border-radius:50%;
  background:#dedede;border:2px solid #6b6b6b;box-shadow:inset 0 2px 3px #0002;
}
.dot.good{background:#2ab85a;border-color:#116a31}
.dot.bad{background:#df3f36;border-color:#7d1915}
.dot.current{outline:3px solid #f2c24f;outline-offset:2px}
#board{
  position:absolute;left:305px;top:375px;width:880px;height:520px;
  display:flex;flex-direction:column;align-items:center;justify-content:flex-start;
  padding:40px 48px 28px;z-index:4;
}
#question{
  width:100%;min-height:92px;display:flex;align-items:center;justify-content:center;
  text-align:center;color:#2b302f;font-size:32px;line-height:1.2;font-weight:900;
}
#answers{
  width:720px;display:grid;grid-template-columns:1fr 1fr;gap:18px 22px;margin-top:24px;
}
.answerBtn{
  min-height:78px;border:4px solid #4c4b43;border-radius:15px;
  background:linear-gradient(#f8f4e7,#e5d7b7);color:#272a2b;
  font-size:23px;font-weight:800;padding:12px 16px;cursor:pointer;
  box-shadow:0 5px 0 #8c7956;
}
.answerBtn:hover{transform:translateY(-2px)}
.answerBtn:disabled{cursor:default;transform:none;opacity:1}
.answerBtn.correct{background:#bce8c7;border-color:#2b8b49}
.answerBtn.wrong{background:#f0bbb6;border-color:#b73b32}
#feedback{
  height:44px;margin-top:22px;font-size:23px;font-weight:900;text-align:center;
}
#nextBtn,#replayBtn{
  border:4px solid #51401f;border-radius:14px;background:#b38a3c;color:#fff;
  font-size:21px;font-weight:900;padding:12px 24px;cursor:pointer;box-shadow:0 5px 0 #624b25;
}
#nextBtn{margin-top:7px}
.hidden{display:none!important}
#endScreen{
  position:absolute;left:305px;top:375px;width:880px;height:520px;z-index:10;
  display:flex;align-items:center;justify-content:center;
}
.endCard{
  width:560px;padding:34px;text-align:center;background:#f5edd9;
  border:7px solid #5f5138;border-radius:22px;box-shadow:0 10px 30px #0006;
}
.endCard h2{font-size:42px;margin:0 0 15px;color:#473d2e}
.endCard p{font-size:25px;font-weight:800;color:#38352e}

/* ===== 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}
#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:#5f533e}
.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 #nextBtn{display:none!important}

/* ===== CORRECTION PANNEAU NIVEAUX 14-18 ===== */
#levels{
  box-sizing:border-box!important;
  height:318px!important;
  min-height:318px!important;
  padding:10px!important;
  overflow:visible!important;
}
#levels .level,
#levels button.level,
button.level[data-level="1"],
button.level[data-level="2"],
button.level[data-level="3"]{
  display:block!important;
  box-sizing:border-box!important;
  position:relative!important;
  width:100%!important;
  height:68px!important;
  min-height:68px!important;
  margin:0 0 12px 0!important;
  padding:0!important;
  border:3px solid #8a6531!important;
  border-radius:12px!important;
  background:linear-gradient(#9a7650,#765537)!important;
  color:#fff!important;
  font:900 20px/62px Arial,sans-serif!important;
  text-align:center!important;
  text-transform:uppercase!important;
  box-shadow:0 5px 0 rgba(45,28,14,.55)!important;
  appearance:none!important;
  -webkit-appearance:none!important;
}
#levels .level:last-child{margin-bottom:0!important}
#levels .level.active{
  border-color:#f2cf69!important;
  box-shadow:0 0 10px 3px #e4b846,0 5px 0 rgba(45,28,14,.55)!important;
}

/* ===== CORRECTION CLICS NIVEAUX ===== */
#levels{
  position:absolute!important;
  z-index:100!important;
  pointer-events:auto!important;
}
#levels .level{
  position:relative!important;
  z-index:101!important;
  pointer-events:auto!important;
  cursor:pointer!important;
}
#levels::before,#levels::after,
#levels .level::before,#levels .level::after{
  pointer-events:none!important;
}

/* ===== RÉPARATION DÉFINITIVE DES 3 NIVEAUX ===== */
#levels{
  box-sizing:border-box!important;
  height:300px!important;
  min-height:300px!important;
  padding:8px!important;
  overflow:visible!important;
  pointer-events:auto!important;
  z-index:20!important;
}
#levels .levelBtn{
  display:block!important;
  box-sizing:border-box!important;
  position:relative!important;
  z-index:21!important;
  pointer-events:auto!important;
  cursor:pointer!important;
  width:100%!important;
  height:72px!important;
  min-height:72px!important;
  margin:0 0 10px 0!important;
  padding:0!important;
  border:5px solid #4e371f!important;
  border-radius:16px!important;
  background:linear-gradient(#8d774f,#614c2e)!important;
  color:#fff!important;
  font-size:23px!important;
  font-weight:900!important;
  line-height:62px!important;
  text-align:center!important;
  text-shadow:0 2px 0 #0008!important;
  box-shadow:0 5px 0 #2d2013!important;
}
#levels .levelBtn:last-child{margin-bottom:0!important}
#levels .levelBtn.active{
  outline:4px solid #d9c27c!important;
  outline-offset:-8px!important;
  filter:brightness(1.12)!important;
}
