:root{font-family:Arial,sans-serif;color:#203e38;background:#f7f5ef;font-size:16px}*{box-sizing:border-box}body{margin:0}header{max-width:1080px;margin:auto;padding:25px 28px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #dedfd6}.brand{font-family:Georgia,serif;font-size:25px;background:none!important;color:#203e38!important;padding:0!important}.tag,.eyebrow{font-size:11px;font-weight:bold;letter-spacing:2px}main{max-width:1000px;margin:48px auto;padding:0 26px;min-height:65vh}h1,h2,h3{font-family:Georgia,serif;font-weight:normal}h1{font-size:clamp(37px,6vw,62px);line-height:1.08;margin:18px 0}h2{font-size:31px;margin:12px 0}h3{font-size:23px;margin:10px 0}p{line-height:1.6;color:#58665e}.lead{max-width:540px;font-size:18px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:22px;margin-top:32px}.panel,.card{background:white;border:1px solid #dedfd6;border-radius:22px;padding:30px}.path{position:relative;overflow:hidden}.path p{min-height:52px}.art{height:96px;display:flex;align-items:center;gap:14px}.shape{width:48px;height:60px;background:#1684c5;border-radius:3px}.triangle{background:#e9c42b;clip-path:polygon(0 0,100% 0,50% 100%)}.oval{background:#dd5857;border-radius:50%;height:65px}.round{background:#399c69;border-radius:50%;height:48px}.steps{display:flex;gap:7px;align-items:center}.steps i{font-style:normal;background:#e5eee7;border-radius:50%;padding:12px;font-size:13px}.steps i:nth-child(even){transform:translateY(15px)}button{font:inherit;cursor:pointer;border:0;border-radius:12px;padding:14px 20px;background:#203e38;color:white;min-height:46px}button:hover{filter:brightness(.94)}button:focus-visible{outline:3px solid #c38f38;outline-offset:4px}button:disabled{cursor:default;opacity:.65}.secondary{background:#e9eee7;color:#203e38}.ghost{background:transparent;color:#516359;padding-left:0}.wide{width:100%}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.between{justify-content:space-between}.muted,small{color:#68766d;font-size:13px}.bar{height:6px;background:#e9ece5;border-radius:20px;margin:16px 0;overflow:hidden}.bar>div{height:100%;background:#58836a}.level{display:flex;gap:18px;align-items:center;padding:20px 0;border-top:1px solid #e4e6df}.number{border:1px solid #cbd3c9;border-radius:50%;width:40px;height:40px;display:grid;place-items:center;flex-shrink:0}.level .text{flex:1}.level p{margin:4px 0;font-size:13px}.quiz{max-width:650px;margin:auto}.quiz h2{font-size:32px;line-height:1.25}.answers{display:grid;gap:10px;margin-top:24px}.answer{background:white;border:1px solid #ced7cd;color:#203e38;text-align:left}.correct{background:#e0efdf!important;border-color:#74a174!important}.wrong{background:#fae5de!important;border-color:#d58a79!important}.feedback{margin-top:22px;padding:20px;border-radius:14px;background:#eef3e9;line-height:1.6}.feedback p{margin:4px 0}.badge{display:inline-block;font-size:12px;padding:7px 11px;border-radius:20px;background:#e9eee7;color:#435c4d}.swatch{display:inline-block;width:12px;height:12px;border-radius:50%;margin-right:7px}.sheet{border-left:6px solid var(--color,#9bac95);margin:15px 0}.sheet p{margin:8px 0}.tabs{margin:20px 0}.active{background:#203e38;color:white}.recall{background:#f5f4ed;padding:20px;border-radius:12px;margin:20px 0}.orderline{padding:13px;border-bottom:1px solid #ddd}.success{font-size:55px;color:#528b65}footer{text-align:center;padding:25px;line-height:1.8;color:#637268}dialog{border:1px solid #ccc;border-radius:20px;max-width:90%;padding:28px}img{max-width:100%}@media(max-width:650px){header{padding:20px}.brand{font-size:21px}.tag{font-size:9px;letter-spacing:1px}main{margin-top:28px;padding:0 18px}.grid{grid-template-columns:1fr}.panel,.card{padding:22px}.level{gap:11px}.level button{padding:12px}.art{height:72px}.path p{min-height:0}h1{font-size:42px}.quiz h2{font-size:27px}}
/* Smartphone shell, also centered at phone width on desktop. */
html{height:100%;background:#e7eae3}body{max-width:460px;margin:auto;height:100dvh;display:flex;flex-direction:column;background:#f7f5ef;box-shadow:0 0 70px #203e3810;overflow:hidden}header{width:100%;flex:none;padding:12px 20px;height:59px;background:#f7f5ef}.brand{font-size:20px!important}.tag{font-size:9px;letter-spacing:1px}main{width:100%;margin:0;padding:20px 20px 105px;min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}footer{display:none}h1{font-size:32px;line-height:1.12;margin:16px 0}h2,.quiz h2{font-size:26px;line-height:1.22}h3{font-size:22px}p{font-size:15px;line-height:1.5}.intro{margin:8px 0 20px}.eyebrow{font-size:10px;letter-spacing:1.5px}.chapter-list{display:grid;gap:15px}.chapter{display:block;width:100%;padding:19px 21px;background:white;color:#203e38;text-align:left;border:1px solid #d9dfd4;border-radius:21px}.chapter h2{font-size:25px;margin:5px 0}.art{height:65px;gap:12px}.shape{width:34px;height:43px}.oval{height:47px}.round{height:34px}.steps{gap:8px}.steps i{padding:8px;background:#e5eee7}.steps i:nth-child(even){transform:translateY(7px)}.bar{margin:13px 0 8px;height:5px}.homefoot{display:flex;justify-content:space-between;align-items:center;font-size:10px;margin-top:12px}.homefoot button{font-size:11px;padding:8px}.screenhead{display:flex;align-items:center;gap:12px;margin:-9px 0 20px;font-size:13px;font-weight:bold}.screenhead .tag{margin-left:auto}.back{border:1px solid #d8dfd3;background:transparent;color:#203e38;padding:0;width:40px;min-height:40px}.leveldots{display:flex;justify-content:space-between;gap:8px;margin:22px 0}.leveldots button{border-radius:50%;min-height:44px;width:44px;padding:0;background:#e7ece3;color:#355346}.leveldots .active{background:#203e38;color:white;box-shadow:0 0 0 4px #dce5d8}.focuscard{background:white;padding:24px;border-radius:23px;border:1px solid #d9dfd4;min-height:236px}.focuscard h2{margin:14px 0}.actionpair{flex-wrap:nowrap;margin-top:22px}.actionpair button{flex:1;padding:14px 10px}.textlink{display:block;margin:13px auto;background:transparent;color:#36594a;font-size:14px}.dock{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,460px);padding:14px 20px max(16px,env(safe-area-inset-bottom));background:#f7f5eff5;border-top:1px solid #dfe3d7;z-index:5}.navcards{flex-wrap:nowrap}.navcards .wide{flex:1;width:auto}.branchlabel{display:block;font-size:12px;margin:16px 0 7px}select{width:100%;padding:13px;border:1px solid #d3dacc;background:white;color:#203e38;font:inherit;border-radius:10px}.flashcard{border:1px solid #d9dfd4;border-top:7px solid var(--color);background:white;border-radius:22px;padding:24px;margin-top:18px;min-height:310px}.flashcard h2{font-size:30px;margin:22px 0}.flashcard p{margin:14px 0}.bigfact{font-size:20px!important;line-height:1.5!important}.mini-art{float:right}.knowledge{padding-left:20px;line-height:1.65;font-size:16px}.hint{font-size:12px;text-align:center;color:#71806f}.quiz{margin:0;max-width:100%}.quiz>.row{flex-wrap:nowrap}.quiz .ghost{font-size:12px}.quiz>.card{padding:22px 18px;border-radius:20px;margin-top:16px!important}.answers{margin-top:18px;gap:8px}.answer{font-size:15px;padding:13px;min-height:48px}.quiz h2 small{display:block;font-size:17px;font-family:Arial,sans-serif;line-height:1.5;color:#4d6557;margin-top:18px}.feedback{margin-top:20px;padding:18px}.feedback p{font-size:17px}.ordertrail{font-size:12px;line-height:1.6;margin-bottom:12px}.orderprogress{font-size:12px;margin:10px 0}.recall{font-size:17px;line-height:1.55}.questioncard .row button{flex:1}.quiz.panel{padding:24px}.success{font-size:48px}button{touch-action:manipulation}button:disabled{opacity:.6}[hidden]{display:none!important}@media(max-height:740px){main{padding-top:13px}h1{font-size:29px;margin:12px 0}.chapter{padding:15px 18px}.art{height:52px}.chapter h2{font-size:23px}.intro{margin-bottom:14px}.focuscard{padding:19px;min-height:215px}.screenhead{margin-bottom:12px}.leveldots{margin:17px 0}.flashcard{min-height:270px}}@media(prefers-reduced-motion:no-preference){.flashcard,.questioncard{animation:appear .16s ease-out}@keyframes appear{from{opacity:.5;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}}
.gameentry{display:block;width:100%;text-align:left;background:white;color:#203e38;border:1px solid #d9dfd4;margin:12px 0;padding:20px}.gameentry h2{font-size:23px}.gameentry p{margin:8px 0}.playentry{width:100%;background:#d7e8cd;color:#203e38;margin:10px 0}.sortrow{display:flex;align-items:center;gap:5px;background:white;padding:8px 5px;border:1px solid #d8dfd3;border-radius:12px;margin:7px 0;min-height:58px}.sortrow>b{flex:1;font-size:13px}.sortrow>span{font-size:12px;width:12px}.sortrow button{padding:4px 7px;min-height:38px;background:#edf1e8;color:#203e38}.sortrow>div{display:flex;gap:3px}.sortrow .handle{touch-action:none;cursor:grab;width:29px}.sortrow.placed{background:#dfefd7}.sortrow.dragging{outline:3px solid #d5a05d}.pairnames{display:flex;flex-wrap:wrap;gap:8px}.pairnames button{flex:1;font-size:14px;padding:12px;background:#e3eadc;color:#203e38}.pairnames button.selected{background:#203e38;color:white;outline:3px solid #c79e5f}.pairfeedback{padding:10px;background:#e9eee4;font-size:14px}.headgame{width:100%;max-height:300px}.headwrap{background:white;border:1px solid #d9dfd4;border-radius:20px;margin:15px 0}.headgame .hit{cursor:pointer}.headgame .hit:focus{outline:none;stroke:#cb772e;stroke-width:4px}.headfeedback{padding:16px;background:#e5eddf;border-radius:12px;line-height:1.5}.compact{min-height:0;margin:13px 0;padding:17px}.compact .row{flex-wrap:nowrap}.compact button{flex:1}.reference{text-align:center;background:white;padding:20px;margin-top:20px;border-radius:15px}.reference img{max-height:55dvh;width:auto;max-width:100%;object-fit:contain}

/* Compact activity screens. Natural overflow remains available for short screens/large text. */
body.playing>header{display:none}
main.activity{padding:10px 12px max(10px,env(safe-area-inset-bottom));scroll-padding:12px}
.activityscreen{min-height:100%;display:flex;flex-direction:column;gap:8px}
.activityscreen .screenhead{margin:0;min-height:44px;flex:none;gap:8px;font-size:0.875rem}
.activityscreen .screenhead .back{width:44px;min-height:44px;flex:none}
.activityscreen .screenhead .tag{display:none}
.activityscreen .gameprompt{margin:0;font-size:1.0rem;color:#203e38;line-height:1.3}
.activityscreen .gamestatus{margin:0;min-height:44px;font-size:0.9375rem;line-height:1.35;padding:7px 8px;background:#e9eee4;border-radius:8px;overflow-wrap:anywhere}
.gameactions{margin-top:auto;padding-top:2px;min-height:48px;display:flex;align-items:center;justify-content:center;flex:none}
.gameactions>button{min-height:46px;padding:10px 12px}
.gameactions .hint{font-size:0.875rem;margin:0}
#sortlist{display:grid;gap:4px;grid-auto-rows:1fr}
.ordergame .sortrow{margin:0;min-height:56px;padding:3px 4px;gap:4px;position:relative;background:#fff}
.ordergame .sortrow>b{font-size:0.875rem;line-height:1.12;min-width:0;overflow-wrap:anywhere}
.ordergame .sortrow button{width:44px;min-width:44px;min-height:44px;padding:0}
.ordergame .sortrow .sortnumber{width:16px;flex:none;font-size:0.875rem;text-align:center}
.ordergame .sortrow>div{gap:2px;flex:none}
.positionstate{display:block;font-family:Arial,sans-serif;font-weight:normal;font-size:0.6875rem;line-height:1.15;margin-top:2px;min-height:13px;color:#354b38}
.ordergame .sortrow.placed{background:#dfefd7;border-color:#658355}
.ordergame .sortrow.misplaced{background:#ffead0;border-color:#b77328}
.ordergame .sortrow.placed button{opacity:.5}
.sortrow.dropplaceholder{background:#dce8ee!important;border:2px dashed #345f75!important}
.sortrow.dropplaceholder>b,.sortrow.dropplaceholder>div,.sortrow.dropplaceholder>.handle{visibility:hidden}
.outside-drop .dropplaceholder{border-color:#a65e21!important}
.dragghost{position:fixed!important;z-index:100;pointer-events:none;margin:0!important;box-shadow:0 8px 20px #203e3850;outline:3px solid #a86b22;opacity:.96;display:flex!important;gap:4px!important;padding:3px 4px!important;min-height:56px!important;background:#fff!important}
.dragghost>b{font-size:0.875rem!important;line-height:1.12;flex:1}
.dragghost button{min-height:44px!important;width:44px;padding:0!important}
.dragghost .sortnumber{width:16px!important;flex:none}
body.sorting{user-select:none;-webkit-user-select:none;touch-action:none}
main.sorting{overflow:hidden!important;touch-action:none}
.pairgame .pairnames{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.pairgame .pairnames button{min-height:86px;padding:7px 5px;font-size:0.9375rem;line-height:1.2;overflow-wrap:anywhere}
.pairdefinitions{display:grid;gap:7px}
.pairdefinitions .answer{min-height:54px;margin:0;font-size:1.0rem;line-height:1.3;padding:10px}
.pairgame .gamestatus{min-height:100px}
.recallrole{margin:6px 0;padding:16px;background:white;border-left:4px solid #799584;font-size:1.1875rem;line-height:1.4}
.image-stage{margin:0;display:flex;align-items:center;justify-content:center;height:clamp(135px,29dvh,245px);background:white;border:1px solid #d9dfd4;border-radius:12px;padding:8px;flex:none}
.image-stage img{display:block;max-height:100%;max-width:100%;width:100%;height:100%;object-fit:contain}
.visualanswers{display:grid;gap:6px}
.visualanswers .answer{margin:0;min-height:46px;padding:10px;font-size:1.0rem;line-height:1.2;text-align:center}
.visualanswers.manyanswers{grid-template-columns:1fr 1fr}
.visualanswers.manyanswers button:last-child{grid-column:1/-1}
.visualgame .gamestatus{min-height:100px}
.activityscreen button:disabled{opacity:.8}
@media(prefers-reduced-motion:no-preference){.ordergame .sortrow{transition:transform .12s ease-out}}

.sortrow.dropplaceholder::after{content:"Déposer ici";position:absolute;left:64px;font-size:.875rem;font-weight:bold;color:#345f75;pointer-events:none}

/* Safe areas also apply when Safari opens the installed app edge to edge. */
body{padding-top:env(safe-area-inset-top);padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
.dock{padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right))}
.pwa-home{margin:8px 0 0;padding-top:7px;border-top:1px solid #dfe3d7;color:#58665e}
.pwa-home p{font-size:13px;line-height:1.4;margin:5px 0}
.pwa-link{display:block;background:transparent;color:#36594a;text-decoration:underline;text-underline-offset:3px;font-size:14px;min-height:44px;padding:8px 0;text-align:left}
#pwa-help,#pwa-updating{width:min(420px,calc(100% - 32px));max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px);overflow:auto;padding:20px;color:#203e38;background:#f7f5ef}
#pwa-help h2{font-size:25px}
#pwa-help ol{padding-left:22px;line-height:1.5}
#pwa-help li{margin:10px 0}
#pwa-help button{display:block;width:100%;margin-top:8px}
dialog::backdrop{background:#203e3866}
