[hidden]{display:none!important}
body[data-view='mindmap'] .branch:has(.topic){padding:0;overflow:hidden;height:22%;top:var(--topic-top);border-top-width:4px}
.branch.top{--topic-top:5%}.branch.middle{--topic-top:39%}.branch.bottom{--topic-top:73%}
body[data-view] .branch .topic{width:100%;height:100%;border:0!important;background:transparent!important;color:var(--accent)!important;box-shadow:none;font:700 clamp(18px,2vw,27px) Georgia,serif;padding:20px;line-height:1.4;text-align:center;border-radius:10px}
body[data-view] .branch .topic:hover{background:#fff5d5!important;transform:none;filter:none}
#training{max-width:1040px;margin:24px auto;padding:22px 28px;background:linear-gradient(120deg,#fffbedf7,#f1dfbaf7);border:2px solid #c59a46;border-radius:18px;box-shadow:0 6px 0 #795937,0 12px 25px #342b2630}
.training-head{display:flex;justify-content:space-between;align-items:center;gap:15px}.training-head p{font-size:14px}#training h1{font-size:29px;margin:20px 0}.level-picker{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:20px}body[data-view] button.level[aria-pressed='true']{background:linear-gradient(#f6dc92,#d7ae59)!important;color:#173e5a!important;box-shadow:0 3px 0 #9b793d}
.exercise-card{background:#fffdf4;border:1px solid #d1b47b;border-radius:14px;padding:24px}#prompt{font-size:23px;line-height:1.5;margin:0 0 25px;font-weight:600}#exercise-form>label{display:block;margin-bottom:8px;font-size:14px}#response{font:22px system-ui,sans-serif;width:min(100%,400px);padding:12px 15px;border:2px solid #a78c56;border-radius:9px;background:white;color:#173e5a}#response:focus-visible{outline:3px solid #7ebbd1;outline-offset:3px}.exercise-actions{display:flex;margin-top:20px;gap:12px}#feedback{margin-top:18px;line-height:1.5}.exercise-feedback{border-radius:9px;padding:12px 15px}.exercise-feedback p{margin:7px 0}.correct{background:#e4f1dd;color:#2f613d}.incorrect{background:#fff0da;color:#85451e}#fraction-entry{display:inline-flex;min-width:120px;text-align:center;gap:0}#fraction-entry #response{border:1px solid #a78c56;border-bottom:2px solid #173e5a;border-radius:6px 6px 0 0;width:160px;text-align:center}#denominator{font-size:23px;padding-top:6px}
@media(max-width:760px){#training{margin:15px 12px;padding:17px}.training-head{flex-wrap:wrap}.training-head p{margin:0}#training h1{font-size:24px}.exercise-card{padding:17px}#prompt{font-size:20px}.topic{min-height:90px}.branch:has(.topic){height:auto!important}}
@media(min-width:761px) and (max-height:800px){#training{margin:16px auto;padding:17px 24px}#training h1{margin:13px 0;font-size:25px}.exercise-card{padding:18px}#prompt{font-size:21px;margin-bottom:17px}.exercise-actions{margin-top:14px}}

#training button{font:600 15px system-ui,sans-serif;padding:11px 18px}#feedback:empty{display:none}

.series-meta{display:flex;justify-content:space-between;gap:14px;color:#526879;font-size:13px;margin-bottom:10px}.series-progress{height:6px;background:#e3d4b7;border-radius:6px;margin-bottom:20px;overflow:hidden}.series-progress span{height:100%;display:block;background:#377f99}
#answer-fields{display:flex;gap:14px;flex-wrap:wrap;align-items:center}
#answer-fields label{display:flex;flex-direction:column;gap:7px;font-size:14px}
#answer-fields input[type=text]{font:19px system-ui,sans-serif;width:min(100%,400px);max-width:100%;padding:10px 12px;border:2px solid #aa8d54;border-radius:8px;background:#fff;color:#173e5a}
#answer-fields input:focus-visible{outline:3px solid #79b7d2;outline-offset:3px}
#answer-fields input:disabled{opacity:1;background:#f7f4e9}
#answer-fields.choice-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}
#answer-fields .exercise-choice{display:flex;flex-direction:row;gap:12px;align-items:center;border:1px solid #bfa16b;padding:12px 15px;border-radius:10px;background:#fff9e9;cursor:pointer;min-height:55px;font-size:16px}
#answer-fields .exercise-choice:has(input:checked){background:#e1eef0;border:2px solid #3e7892}
#answer-fields .exercise-choice input{accent-color:#245c78}
#answer-fields.decomposition-fields{display:grid;grid-template-columns:repeat(6,1fr);gap:12px}
#answer-fields.decomposition-fields input{width:100%;font-size:17px;padding:8px}
#answer-fields.decomposition-fields label{font-size:12px}
#answer-fields .entry-fraction input{border-radius:6px 6px 0 0;border-bottom:2px solid #173e5a;width:150px;text-align:center}
#answer-fields .entry-fraction>span{font-size:20px;padding:7px}
#answer-fields.mixed-fields>input{width:130px}
#series-score{font:700 42px Georgia,serif;color:#1b6071;margin:15px 0}
#series-review{padding-left:22px;line-height:1.6;font-size:15px;margin:12px 0 20px}
#series-summary{line-height:1.5;margin-bottom:8px}#training #series-result-title{font-size:27px;margin:0}
#training mark{background:#f5d77e;border-radius:3px;padding:0 1px}
#training .number{white-space:nowrap}
/* Six médaillons de numération, dans l’univers du village. */
body.mastery-page[data-view='mindmap'] .branch:has(.topic){width:30%;height:29%;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible;justify-content:center}
body.mastery-page .branch.left{left:1%}body.mastery-page .branch.right{right:1%}
body.mastery-page .branch.top{top:1%}body.mastery-page .branch.middle{top:35.5%}body.mastery-page .branch.bottom{top:70%}
body.mastery-page[data-view] .branch .topic{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:11px;padding:0;color:#173e5a!important}
body.mastery-page[data-view] .branch .topic:hover{background:transparent!important}
.medallion{position:relative;width:clamp(100px,11vw,150px);height:clamp(100px,11vw,150px);flex-shrink:0;display:flex;align-items:center;justify-content:center;flex-direction:column;color:#fff0bf;background:radial-gradient(circle at 35% 25%,#397393,#173f5d 62%,#0e2a43);border:5px solid #d0ac5d;border-radius:50%;box-shadow:inset 0 0 0 3px #173d59,inset 0 0 0 5px #e4c575,0 5px 0 #74522d,0 9px 17px #263b4938;text-shadow:0 2px 2px #102d43;font-family:Georgia,serif;transition:transform .18s,box-shadow .18s}
.medallion::after{content:'✦';position:absolute;top:-13px;left:calc(50% - 10px);font-size:20px;color:#f6dc94;text-shadow:0 1px 2px #664a29}
.topic-title{display:block;max-width:100%;min-width:220px;padding:9px 15px;border:2px solid #bf9750;border-radius:10px;background:linear-gradient(#fff9e7,#eed8a6);box-shadow:inset 0 0 0 2px #fff9e7,0 3px 0 #74522d;color:#173e5a;font:700 clamp(16px,1.5vw,21px)/1.35 Georgia,serif;text-shadow:0 1px #fff}
.topic:hover .medallion{transform:translateY(-4px) scale(1.04);box-shadow:inset 0 0 0 3px #173d59,inset 0 0 0 5px #e4c575,0 6px 0 #74522d,0 13px 20px #263b4950}
.topic:focus-visible{outline:3px solid #173e5a!important;outline-offset:5px}
.engraved-digits{font-size:clamp(25px,3.4vw,45px);font-weight:700;white-space:nowrap}.crest-caption{font:10px system-ui,sans-serif;letter-spacing:.13em;margin-top:5px;color:#edd7a1}
.decimal-symbol{font-size:clamp(23px,3vw,40px);font-weight:700}.decimal-symbol>span{color:#79d7ed;font-size:1.3em}
.zero-symbol{font-size:clamp(48px,6vw,76px);line-height:.9;color:#bce9d7}.medallion-zero .crest-caption{margin-top:10px}
.rank-symbol{display:flex;gap:4px;padding:5px}.rank-symbol>span{display:flex;flex-direction:column;align-items:center;font:12px system-ui,sans-serif;color:#e6d7ad;border-right:1px solid #e4c57570;padding:0 6px}.rank-symbol>span:last-child{border:0}.rank-symbol b{font:700 clamp(24px,3vw,40px) Georgia,serif;color:#fff0bf;margin-top:3px}
.crest-fraction{display:flex;flex-direction:column;align-items:center;font:700 clamp(24px,3vw,40px)/1.1 Georgia,serif}.crest-fraction>span:first-child{padding:0 10px 5px;border-bottom:2px solid #fff0bf}.crest-fraction>span:last-child{padding-top:5px}
.equivalent-symbol{display:flex;flex-direction:column;align-items:center;gap:3px;font-size:clamp(14px,1.5vw,20px)}.equivalent-symbol>b{font-size:25px;color:#93daee}.tiny-fraction{display:inline-flex;vertical-align:middle;flex-direction:column;align-items:center;font-size:11px;line-height:1.1}.tiny-fraction>span:first-child{border-bottom:1px solid currentColor;padding:0 3px 2px}.tiny-fraction>span:last-child{padding-top:2px}
@media(min-width:761px) and (max-height:800px){.medallion{width:104px;height:104px}.topic-title{padding:7px 12px;font-size:17px}.engraved-digits{font-size:30px}.decimal-symbol{font-size:28px}.zero-symbol{font-size:52px}.rank-symbol b{font-size:29px}.crest-fraction{font-size:28px}.equivalent-symbol{font-size:16px}body.mastery-page[data-view] .branch .topic{gap:9px}}
@media(max-width:760px){body.mastery-page[data-view='mindmap'] .branch:has(.topic){width:100%;height:auto;min-height:210px}body.mastery-page .branch.left,body.mastery-page .branch.right{left:auto;right:auto}.topic-title{min-width:0;width:100%;max-width:340px}.medallion{width:120px;height:120px}.engraved-digits{font-size:34px}.decimal-symbol{font-size:30px}.zero-symbol{font-size:60px}.rank-symbol b{font-size:32px}.crest-fraction{font-size:32px}.equivalent-symbol{font-size:18px}}
@media(prefers-reduced-motion:reduce){.medallion{transition:none}.topic:hover .medallion{transform:none}}
#training #prompt{font-size:21px;line-height:1.45;margin-bottom:18px}
@media(min-width:761px) and (max-height:800px){#training{margin:12px auto;padding:13px 22px}#training h1{font-size:24px;margin:10px 0}.level-picker{margin-bottom:13px}.series-progress{margin-bottom:14px}.exercise-card{padding:15px 18px}#training #prompt{font-size:18px;margin-bottom:14px}#feedback{margin-top:12px}.exercise-feedback{padding:9px 12px}.exercise-feedback p{font-size:13px;line-height:1.4}#answer-fields.decomposition-fields{gap:8px}#answer-fields input[type=text]{padding:8px 10px;font-size:17px}}
@media(max-width:760px){.series-meta{flex-direction:column;gap:4px}#answer-fields.choice-fields{grid-template-columns:1fr}#answer-fields.decomposition-fields{grid-template-columns:repeat(3,1fr)}#training #prompt{font-size:19px}#answer-fields input[type=text]{font-size:18px}#answer-fields.standard-fields{display:grid;grid-template-columns:1fr;width:100%}.training-head p{font-size:12px}}

/* Plaques rectangulaires illustrées. */
body.mastery-page .medallion{width:clamp(170px,17vw,235px);height:clamp(105px,10vw,135px);border-radius:16px;background:linear-gradient(140deg,#397393,#173f5d 65%,#0e2a43)}
@media(min-width:761px) and (max-height:800px){body.mastery-page .medallion{width:185px;height:104px;border-radius:14px}}
@media(max-width:760px){body.mastery-page .medallion{width:200px;height:120px;border-radius:15px}}

body.mastery-page[data-view]{--village-scene:url("assets/cour-entree-je-maitrise.png")}

body.mastery-page .central::before{display:none!important;content:none!important}
body.mastery-page .topic-title{width:100%;min-width:0;height:66px;flex-shrink:0;display:flex;align-items:center;justify-content:center;text-align:center;padding:8px 14px;box-sizing:border-box}
body.mastery-page .topic{align-items:center}
@media(min-width:761px) and (max-height:800px){body.mastery-page .topic-title{height:58px;padding:7px 12px}}
@media(max-width:760px){body.mastery-page .topic-title{width:100%;max-width:340px;height:66px}}
/* Cibles et enseignes colorées validées. */
body.mastery-page .medallion{width:158px;height:158px;border-radius:50%;border:7px solid #9c713d;background:radial-gradient(circle,#163f5b 0 48%,#e5b54d 49% 54%,#b85242 55% 64%,#f8ecd2 65% 76%,#3b759b 77% 88%,#fff1d5 89%);box-shadow:inset 0 0 0 2px #f3d496,0 5px 0 #674726,0 8px 16px #33261e66;text-shadow:0 2px 2px #102d43}
body.mastery-page .medallion::after{display:none}
body.mastery-page .engraved-digits{font-size:31px}body.mastery-page .decimal-symbol{font-size:29px}body.mastery-page .zero-symbol{font-size:55px}body.mastery-page .rank-symbol{gap:0}body.mastery-page .rank-symbol>span{font-size:9px;padding:0 3px}body.mastery-page .rank-symbol b{font-size:26px}body.mastery-page .crest-fraction{font-size:30px}body.mastery-page .equivalent-symbol{font-size:16px}body.mastery-page .crest-caption{font-size:8px}
body.mastery-page[data-view] .branch .topic{gap:9px}
body.mastery-page .topic-title{margin-top:0;background:var(--accent);color:#fff4d7;border:5px solid #936431;border-radius:11px;box-shadow:inset 0 0 0 2px #e2bd71,0 4px 0 #543b24;text-shadow:0 1px 1px #18364c;padding:9px 12px}
@media(min-width:761px) and (max-height:800px){body.mastery-page .medallion{width:125px;height:125px}body.mastery-page .engraved-digits{font-size:27px}body.mastery-page .decimal-symbol{font-size:25px}body.mastery-page .crest-fraction{font-size:25px}body.mastery-page .equivalent-symbol{font-size:13px}body.mastery-page .zero-symbol{font-size:45px}}
@media(max-width:760px){body.mastery-page[data-view='mindmap'] .branch:has(.topic){min-height:240px}}
/* Retour aux médaillons rectangulaires bleus et dorés. */
body.mastery-page .medallion{width:clamp(170px,17vw,235px);height:clamp(105px,10vw,135px);border:5px solid #d0ac5d;border-radius:16px;background:linear-gradient(140deg,#397393,#173f5d 65%,#0e2a43);box-shadow:inset 0 0 0 3px #173d59,inset 0 0 0 5px #e4c575,0 5px 0 #74522d,0 9px 17px #263b4938}
body.mastery-page .medallion::after{display:block}
@media(min-width:761px) and (max-height:800px){body.mastery-page .medallion{width:185px;height:104px;border-radius:14px}}
@media(max-width:760px){body.mastery-page .medallion{width:200px;height:120px;border-radius:15px}}

/* Bilan : mêmes ancrages et espacements que le chapitre 2. */
body #training .training-head{align-items:center}
body #training .training-head p{font-size:13px}
body #training #back-topics{font-weight:600;font-size:15px;padding:11px 18px;line-height:1.4}
body #training>h1{margin:20px 0;font-size:29px}
body #training #series-result-title{font:700 29px Georgia,serif;margin:0 0 12px}
body #training #series-score{font:700 40px Georgia,serif;color:#176c80;margin:12px 0}
body #training #series-review:empty{display:none}
body #training #restart-series{display:inline-block;margin-top:6px;padding:9px 14px;font-size:15px;line-height:1.4}
@media(min-width:761px) and (max-height:800px){body #training>h1{font-size:24px;margin:10px 0}}

/* Le titre long conserve son panneau et tient sur une seule ligne. */
body.mastery-page .branch.right.bottom .topic-title{white-space:nowrap;font-size:clamp(12px,1.3vw,18px)}

