.priority-rule{display:flex;gap:12px;align-items:center;margin:15px 0;line-height:1.5}.priority-rule>b{display:grid;place-items:center;min-width:35px;height:35px;border-radius:12px;background:#fde0ef;color:#b12662}.math-worked{display:grid;gap:10px;padding:18px;background:#f6f1fc;border-radius:18px;margin:14px 0;font-size:1.1rem}.math-worked small{display:block;font-size:.78rem;color:#675276;line-height:1.4;margin-top:4px}.math-worked>b{color:#268359}.math-levels{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:15px 0}.math-levels button{padding:13px 8px;border-radius:16px;background:#fff;border:2px solid #e8dff1;color:#473457;font-weight:800;cursor:pointer}.math-levels button small{display:block;font-size:.65rem;font-weight:500;margin-top:5px}.math-levels button[aria-pressed=true]{background:#342447;border-color:#342447;color:#fff}.math-levels button:disabled{opacity:.5;cursor:default}.math-level-summary{display:flex;justify-content:space-between;gap:12px;font-size:.8rem;margin:15px 0}.math-level-summary strong{color:#b72368}.math-expression{font-size:clamp(1.7rem,6vw,2.6rem);line-height:1.4;font-weight:900;text-align:center;background:#faf3fb;padding:24px 12px;border-radius:20px;overflow-wrap:anywhere;letter-spacing:.015em}.math-input-label{display:block;font-weight:800;font-size:.85rem;margin:18px 0 7px}.math-explanation{padding:17px;background:#eef7ff;border-radius:17px;margin-top:15px;color:#324c65;line-height:1.6}.math-explanation ol{padding-left:22px}.math-explanation li{margin:8px 0}.math-progress{width:100%;accent-color:#ed3f88;height:10px}.math-meta{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;color:#6f587d;font-size:.78rem}.math-meta b{color:#b02761}.math-robot{font-size:.9rem;color:#86601e;background:#fff4df;padding:13px;border-radius:14px}.math-celebration{background:linear-gradient(120deg,#fcdeed,#ebe2ff);padding:20px;border-radius:20px;animation:math-pop .3s ease-out}.math-celebration strong{display:block;font-size:1.2rem}.math-celebration p{margin-bottom:0}.math-delta{font-weight:900;color:#16865c;animation:math-pop .3s ease-out}.math-exercise{animation:math-pop .2s ease-out}.math-worked,.math-explanation{overflow-wrap:anywhere}.math-course-toggle{width:100%;padding:16px;background:#fff;border:1px solid #e7d8ef;border-radius:16px;color:#5f3f75;text-align:left;font-weight:800}.math-training-choice{font:inherit;cursor:pointer}.math-training-choice:hover{border-color:#ed3f88}.math-explanation[hidden],.math-celebration[hidden]{display:none}@keyframes math-pop{from{opacity:.4;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.math-celebration,.math-delta,.math-exercise{animation:none}}@media(max-width:370px){.mission-card{padding:16px}.math-levels{grid-template-columns:repeat(2,1fr)}}
.math-training-active .mission-hero h1{font-size:1.45rem;margin:8px 0}.math-training-active .mission-hero h1 br{display:none}.math-training-active .mission-hero p,.math-training-active .back-link{display:none}.math-training-active .math-levels small{display:none}.math-training-active .math-levels button{padding:9px}.math-training-active .math-course-toggle{padding:12px}.math-training-active .mission-card{margin-top:12px}.math-training-active .math-level-summary{margin:10px 0}
.math-chain-expression{display:flex;justify-content:center;align-items:center;gap:5px;flex-wrap:wrap;padding:19px 10px;font-variant-numeric:tabular-nums}.math-chain-expression span{border-radius:8px;padding:2px;transition:background .16s,color .16s}.math-chain-expression .math-group-highlight{background:#ed3f88;color:#fff}.math-chain-help{font-size:.85rem;line-height:1.5;color:#665174}.math-chain-groups{display:flex;flex-wrap:wrap;justify-content:center;gap:9px;margin:16px 0}.math-chain-group{min-height:52px;flex:1 1 110px;border:2px solid #e5d4f4;border-radius:16px;padding:13px 10px;background:#fff;color:#3d2358;font:inherit;font-weight:850;cursor:pointer;transition:transform .12s,background .12s}.math-chain-group:hover,.math-chain-group:focus-visible{border-color:#c62a72;background:#fff0f7;outline:2px solid #ed3f88;outline-offset:2px}.math-chain-group:active{transform:scale(.96)}.math-chain-group:disabled{opacity:.65;cursor:default}.math-chain-last{font-weight:800;color:#127c55;line-height:1.5;font-size:.86rem}.math-chain-last:empty,.math-chain-trail:empty{display:none}.math-chain-trail{padding:12px 12px 12px 32px;background:#f4f8fc;border-radius:14px;font-size:.8rem;line-height:1.5;color:#3e546b;max-height:180px;overflow:auto}.math-chain-trail li+li{margin-top:8px}.math-chain-trail span{display:block}.math-chain-change{animation:math-pop .24s ease-out}.math-admin-restart{margin:24px 0;padding:16px;border:1px dashed #ccb8d9;border-radius:16px;font-size:.8rem;color:#655173}.math-admin-restart summary{cursor:pointer;font-weight:800;min-height:32px}.math-admin-restart p{line-height:1.5}.math-admin-restart [hidden]{display:none}@media(prefers-reduced-motion:reduce){.math-chain-change{animation:none}.math-chain-expression span,.math-chain-group{transition:none}}
@media(max-width:600px){.math-training-active .math-levels{grid-template-columns:repeat(6,1fr);gap:5px}.math-training-active .math-levels button{min-height:44px;padding:8px 3px}.math-training-active .mission-hero h1{font-size:1.2rem}.math-training-active .math-chain h2{font-size:1.15rem}.math-training-active .math-level-caption{font-size:.74rem}.math-training-active .math-chain-expression{padding:15px 8px}.math-training-active .math-chain-help{font-size:.8rem}}
/* Le jeu privilégie le calcul ; les explications restent disponibles à la demande. */
.math-inline{gap:3px;min-height:140px;touch-action:manipulation;user-select:none}.math-inline .math-number,.math-inline .math-bracket{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:2px 3px}.math-inline .math-number{cursor:pointer}.math-inline .math-operator{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:44px;min-height:48px;padding:2px 6px;border:2px solid #efbad4;border-radius:13px;background:#fff;color:#ac215f;font:inherit;font-weight:900;line-height:1;cursor:pointer;box-shadow:0 3px 0 #ead6e4;transition:background .14s,transform .14s,color .14s;touch-action:manipulation}.math-inline .math-operator:active{transform:translateY(2px);box-shadow:none}.math-inline .math-operator:focus-visible{outline:3px solid #823ece;outline-offset:3px}.math-inline .math-operator.math-group-highlight{background:#ed3f88;color:#fff;border-color:#ed3f88}.math-inline .math-operator:disabled{cursor:default;opacity:.7}.math-chain-wrong{animation:math-chain-shake .24s ease-out}@keyframes math-chain-shake{25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}@media(prefers-reduced-motion:reduce){.math-chain-wrong{animation:none}.math-inline .math-operator{transition:none}}
.math-training-active .mission-hero{display:none}#math-status:empty{display:none}.math-training-active .math-meta{font-size:.72rem;gap:8px;margin:8px 0}.math-training-active .math-levels{grid-template-columns:repeat(6,1fr);gap:5px;margin:10px 0}.math-training-active .math-levels button{min-height:44px;padding:8px 3px}.math-training-active .math-course-toggle{width:auto;min-height:44px;padding:10px 14px;font-size:.8rem}.math-training-active .math-level-summary{align-items:center;font-size:.75rem;gap:8px;margin:10px 0 6px}.math-training-active .math-level-summary span{white-space:nowrap}.math-training-active .math-progress{height:7px}.math-training-active .math-exercise{padding:20px;margin-top:10px}.math-training-active .math-exercise .eyebrow{font-size:.65rem;margin:0 0 8px}.math-training-active .math-exercise h2{font-size:1.15rem;margin-bottom:12px}.math-training-active .math-expression{font-size:clamp(1.8rem,7vw,2.65rem);padding:22px 10px}.math-training-active .math-chain-groups{margin:16px 0 8px}.math-training-active .mission-feedback:empty{display:none}.math-training-active .mission-feedback{padding:10px;margin:10px 0;font-size:.82rem}.math-training-active .math-chain-last{margin:8px 0}.math-tools{margin-top:10px;font-size:.8rem;color:#6d557e}.math-tools summary{display:flex;align-items:center;min-height:44px;cursor:pointer;font-weight:700}.math-tools[open] summary{color:#b12662}.math-tools .mission-actions{margin-top:4px}.math-tools .math-chain-trail{margin-top:4px}.math-training-active .math-celebration{padding:12px;margin-top:10px}.math-training-active .math-celebration strong{font-size:1rem}
