/* PAFENKI P201 — Système adaptatif unique pour téléphone / tablette.
   Remplace AU CHARGEMENT p191-mobile.css, p196-mobile.css et p200-workshop.css.
   L'ordinateur garde les styles historiques ; un seul état .p191-mobile pour les vues tactiles.
   Référence : taille du conteneur, safe areas iOS, commandes >=44px, zéro déformation du canvas. */
#p191Camera,#p196Add,#p196Armed,#p196View,#p196More,#p196Dismiss,#p196Options,#p196ViewPanel,#p196SheetHead,#p196SelectionSlot,#p196Minimap,#p196Live{display:none!important}
html.p191-mobile {--p201-top:58px;--p201-dock:70px;--p201-play-dock:76px;--p201-gutter:8px;--p201-surface:#000;--p201-text:var(--fond);overscroll-behavior:none}
html.p191-mobile body[data-screen="workspace"] {overflow:hidden!important;overscroll-behavior:none!important}
html.p191-mobile #app:not([hidden]) {
 position:fixed!important;inset:0 auto auto 0!important;width:100%!important;height:var(--p201-vh,100dvh)!important;
 min-height:0!important;max-height:none!important;padding:0!important;margin:0!important;
 display:block!important;overflow:hidden!important;background:var(--matiere)!important;
}
html.p191-mobile #app .topline,html.p191-mobile #editorToolbar,html.p191-mobile #gameToolbar,html.p191-mobile #tools,
html.p191-mobile #editorFooter,html.p191-mobile #inviteHint {display:none!important}
html.p191-mobile #app .workspace {
 display:grid!important;grid-template-rows:var(--p201-top) minmax(0,1fr) var(--p201-dock)!important;
 grid-template-columns:minmax(0,1fr)!important;gap:0!important;align-content:stretch!important;
 width:100%!important;max-width:none!important;min-width:0!important;
 height:100%!important;max-height:100%!important;min-height:0!important;
 margin:0!important;padding:0!important;overflow:hidden!important;background:var(--matiere)!important;
}
html.p191-mobile #app .workspace::after {content:none!important;display:none!important}
html.p191-mobile #p53Top {
 position:relative!important;grid-row:1!important;display:flex!important;align-items:center!important;
 flex-wrap:nowrap!important;justify-content:space-between!important;inset:auto!important;
 width:100%!important;height:var(--p201-top)!important;min-height:0!important;max-height:var(--p201-top)!important;
 min-width:0!important;padding:3px max(var(--p201-gutter),env(safe-area-inset-right)) 3px max(var(--p201-gutter),env(safe-area-inset-left))!important;
 margin:0!important;gap:5px!important;box-sizing:border-box!important;
 z-index:36!important;background:var(--matiere)!important;color:var(--fond)!important;overflow:hidden!important;
}
html.p191-mobile #p53Top .p53-brand{display:flex!important;align-items:center!important;flex:0 1 100px!important;min-width:56px!important;max-width:100px!important;overflow:hidden!important}
html.p191-mobile #p53Top .p53-brand small{display:none!important}
html.p191-mobile #p189Home {display:flex!important;align-items:center!important;min-width:0!important;width:100%!important;height:44px!important;min-height:44px!important;
 padding:0!important;margin:0!important;border:0!important;background:transparent!important;color:var(--fond)!important;
 font:900 clamp(12px,3.3vw,16px)/1 system-ui,sans-serif!important;white-space:nowrap!important}
html.p191-mobile #p53Top .p53-top-actions{display:flex!important;flex:1 1 auto!important;align-items:center!important;justify-content:flex-end!important;
 min-width:0!important;width:auto!important;max-width:none!important;height:100%!important;gap:5px!important;flex-wrap:nowrap!important;overflow:hidden!important}
html.p191-mobile #p53Top .p53-top-actions > *{min-height:44px!important;max-height:44px!important;flex:0 1 auto!important;white-space:nowrap!important;min-width:0!important}
html.p191-mobile #p53Save {display:flex!important;align-items:center!important;justify-content:center!important;min-width:78px!important;
 padding:0 7px!important;background:transparent!important;color:var(--fond)!important;border:0!important;font:800 13px/1 system-ui,sans-serif!important}
html.p191-mobile #p53Test {display:flex!important;align-items:center!important;justify-content:center!important;min-width:70px!important;
 padding:0 10px!important;border:0!important;border-radius:13px!important;background:#FFE6A3!important;color:#000!important;font:900 14px/1 system-ui,sans-serif!important}
html.p191-mobile #p196More {display:flex!important;align-items:center!important;justify-content:center!important;flex:0 0 44px!important;
 width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:0!important;
 background:transparent!important;color:var(--fond)!important;border:0!important;font:800 27px/1 system-ui,sans-serif!important}
html.p191-mobile #p196More[aria-expanded="true"]{color:#FFE6A3!important}
html.p191-mobile #stageShell.stage-shell {
 grid-row:2!important;position:relative!important;inset:auto!important;display:block!important;
 width:100%!important;max-width:none!important;min-width:0!important;
 height:100%!important;min-height:0!important;max-height:none!important;
 margin:0!important;padding:0!important;aspect-ratio:auto!important;
 align-self:stretch!important;justify-self:stretch!important;
 border:0!important;border-radius:0!important;background:var(--fond)!important;
 overflow:hidden!important;overscroll-behavior:contain!important;touch-action:none!important;z-index:1!important;
}
html.p191-mobile #stageShell #stage,html.p191-mobile #stageShell #fxSky{position:absolute!important;display:block!important;transform-origin:top left!important;
 max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important;aspect-ratio:auto!important;
 touch-action:none!important;user-select:none!important;-webkit-user-select:none!important}
html.p191-mobile #stageShell #fxSky[hidden]{display:none!important}
html.p191-mobile #stageShell #stage{cursor:crosshair!important}
html.p191-mobile #p62RobotDock {
 position:relative!important;grid-row:3!important;display:flex!important;flex-wrap:nowrap!important;
 align-items:center!important;justify-content:space-between!important;
 width:100%!important;height:var(--p201-dock)!important;min-width:0!important;min-height:0!important;max-height:var(--p201-dock)!important;
 padding:4px max(var(--p201-gutter),env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(var(--p201-gutter),env(safe-area-inset-left))!important;
 margin:0!important;gap:5px!important;box-sizing:border-box!important;overflow:hidden!important;
 background:var(--matiere)!important;color:var(--fond)!important;z-index:37!important;
}
html.p191-mobile #p196Add,html.p191-mobile #p196Armed,html.p191-mobile #p196View,
html.p191-mobile #p62RobotDock #p53Undo,html.p191-mobile #robotTest{
 display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 1 auto!important;
 height:48px!important;min-height:44px!important;max-height:52px!important;min-width:44px!important;
 padding:6px 10px!important;margin:0!important;border:0!important;border-radius:12px!important;
 background:transparent!important;color:var(--fond)!important;box-shadow:none!important;font:800 13px/1.1 system-ui,sans-serif!important;
 text-align:center!important;white-space:normal!important;overflow:hidden!important;
}
html.p191-mobile #p196Add{background:#FFE6A3!important;color:#000!important;flex:1 1 114px!important;max-width:180px!important}
html.p191-mobile #p196Armed{background:#FFE6A3!important;color:#000!important;flex:1 1 160px!important}
html.p191-mobile #p196View{flex:0 1 68px!important}
html.p191-mobile #p62RobotDock #p53Undo{font-size:22px!important;flex:0 0 44px!important;padding:0!important}
html.p191-mobile #robotTest{flex:0 1 110px!important;max-width:125px!important}
html.p191-mobile #p196Add[hidden],html.p191-mobile #p196Armed[hidden]{display:none!important}
html.p191-mobile #p196SelectionSlot {display:none!important}
html.p191-mobile.p196-selection #p62RobotDock>*:not(#p196SelectionSlot){display:none!important}
html.p191-mobile.p196-selection #p196SelectionSlot{display:flex!important;align-items:center!important;justify-content:stretch!important;flex:1 1 100%!important;width:100%!important;min-width:0!important;height:100%!important}
html.p191-mobile #p196SelectionSlot #p126SelectionBar{display:flex!important;position:static!important;inset:auto!important;transform:none!important;
 justify-content:space-between!important;align-items:center!important;gap:6px!important;
 width:100%!important;max-width:100%!important;min-width:0!important;height:auto!important;max-height:100%!important;padding:0!important;margin:0!important;
 overflow-x:auto!important;overflow-y:hidden!important;background:transparent!important;color:var(--fond)!important;border:0!important;box-shadow:none!important}
html.p191-mobile #p196SelectionSlot #p126SelectionBar[hidden]{display:none!important}
html.p191-mobile #p196SelectionSlot #p126SelectionBar .p126-selection-label{display:none!important}
html.p191-mobile #p196SelectionSlot #p126SelectionBar button{display:flex!important;justify-content:center!important;align-items:center!important;min-width:92px!important;min-height:44px!important;
 padding:5px 9px!important;white-space:nowrap!important;border-radius:12px!important;font:800 13px/1 system-ui,sans-serif!important}
/* Panneaux d'outils : ils s'ouvrent seulement à la demande, ne déterminent pas la hauteur de la scène. */
html.p191-mobile #p53Tools.p60-palette {
 display:flex!important;position:absolute!important;z-index:48!important;left:0!important;right:0!important;bottom:var(--p201-dock)!important;top:auto!important;
 width:100%!important;max-width:100%!important;height:clamp(165px,39%,292px)!important;max-height:calc(100% - var(--p201-top) - var(--p201-dock) - 12px)!important;
 min-height:0!important;box-sizing:border-box!important;flex-direction:column!important;flex-wrap:nowrap!important;
 padding:4px 10px 10px!important;margin:0!important;gap:2px!important;
 overflow:hidden!important;background:var(--matiere)!important;color:var(--fond)!important;box-shadow:0 -8px 20px #0004!important;
 visibility:hidden!important;pointer-events:none!important;transform:translateY(105%)!important;transition:transform .15s ease,visibility .15s!important;
}
html.p191-mobile.p196-palette-open #p53Tools.p60-palette{visibility:visible!important;pointer-events:auto!important;transform:translateY(0)!important}
html.p191-mobile #p196SheetHead{display:flex!important;justify-content:space-between!important;align-items:center!important;flex:0 0 44px!important;min-height:44px!important;gap:7px!important}
html.p191-mobile #p196SheetTitle{font:900 15px/1 system-ui,sans-serif!important}
html.p191-mobile #p196Close{display:flex!important;align-items:center!important;justify-content:center!important;min-width:44px!important;min-height:44px!important;font-size:24px!important}
html.p191-mobile #p189CategoryBar{display:flex!important;align-items:center!important;flex:0 0 44px!important;gap:6px!important;overflow-x:auto!important;overflow-y:hidden!important;touch-action:pan-x!important;scrollbar-width:thin!important}
html.p191-mobile #p189CategoryBar button{min-height:44px!important;min-width:68px!important;padding:4px 11px!important;font:800 12px/1 system-ui,sans-serif!important;white-space:nowrap!important}
html.p191-mobile #p53Tools .p60-group{display:none!important}
html.p191-mobile #p53Tools .p60-group.p189-selected{display:flex!important;flex:1 1 auto!important;min-height:75px!important;height:auto!important;overflow-x:auto!important;overflow-y:hidden!important;touch-action:pan-x!important;overscroll-behavior-x:contain!important;scrollbar-width:thin!important}
html.p191-mobile #p53Tools .p60-group-contents{display:flex!important;align-items:flex-start!important;flex-wrap:nowrap!important;gap:9px!important;min-height:90px!important;touch-action:pan-x!important}
html.p191-mobile #p53Tools .p60-tool{display:flex!important;flex:0 0 86px!important;width:86px!important;min-width:86px!important;max-width:86px!important;height:90px!important;min-height:90px!important;gap:5px!important;padding:5px 2px!important;white-space:normal!important;touch-action:pan-x!important}
html.p191-mobile #p53Tools .p60-icon,html.p191-mobile #p53Tools .p60-silhouette{width:50px!important;height:46px!important}
html.p191-mobile #p53Tools .p60-name{font:800 12px/1.1 system-ui,sans-serif!important;max-width:84px!important}
html.p191-mobile #p196Dismiss {display:block!important;position:absolute!important;z-index:43!important;inset:var(--p201-top) 0 var(--p201-dock) 0!important;border:0!important;background:transparent!important}
html.p191-mobile #p196Dismiss[hidden]{display:none!important}
html.p191-mobile #p196Options,html.p191-mobile #p196ViewPanel{
 display:flex!important;flex-direction:column!important;align-items:stretch!important;position:absolute!important;z-index:49!important;box-sizing:border-box!important;
 visibility:hidden!important;pointer-events:none!important;overflow:auto!important;overscroll-behavior:contain!important;touch-action:pan-y!important;
 gap:6px!important;padding:10px!important;background:var(--matiere)!important;color:var(--fond)!important;box-shadow:0 8px 22px #0005!important;
}
html.p191-mobile #p196Options{right:8px!important;top:calc(var(--p201-top) + 4px)!important;width:min(310px,calc(100% - 16px))!important;max-height:calc(100% - var(--p201-top) - var(--p201-dock) - 10px)!important}
html.p191-mobile #p196ViewPanel{left:50%!important;right:auto!important;bottom:calc(var(--p201-dock) + 5px)!important;transform:translateX(-50%)!important;width:min(310px,calc(100% - 16px))!important}
html.p191-mobile.p196-options-open #p196Options,html.p191-mobile.p196-view-open #p196ViewPanel{visibility:visible!important;pointer-events:auto!important}
html.p191-mobile #p196OptionsTitle{font:900 14px/1.1 system-ui,sans-serif!important;margin-bottom:4px!important}
html.p191-mobile #p196Options>*:not(strong),html.p191-mobile #p196ViewPanel button{min-height:44px!important;min-width:44px!important;display:flex!important;align-items:center!important;justify-content:center!important;font-size:13px!important}
html.p191-mobile #p196ViewPanel #p191Camera{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-around!important;gap:4px!important}
html.p191-mobile #p191Camera button{min-width:44px!important;min-height:44px!important;flex:1 1 auto!important;font-size:22px!important}
html.p191-mobile #p196ViewHint{font:600 12px/1.4 system-ui,sans-serif!important;opacity:.9!important}
html.p191-mobile #p196Minimap:not([hidden]){display:block!important;position:absolute!important;z-index:29!important;right:8px!important;top:8px!important;bottom:auto!important;
 width:min(156px,40%)!important;height:44px!important;min-height:44px!important;padding:0!important;margin:0!important;border-radius:10px!important;
 background:color-mix(in srgb,var(--fond) 92%,transparent)!important;box-shadow:0 3px 9px #0003!important;opacity:.92!important;touch-action:none!important;cursor:grab!important}
html.p191-mobile #p196Minimap:active{cursor:grabbing!important}
html.p191-mobile #p196Minimap::before{content:"";position:absolute;left:10px;right:10px;top:25px;height:11px;border-radius:8px;background:color-mix(in srgb,var(--matiere) 25%,transparent);pointer-events:none}
html.p191-mobile #p196MinimapRange{display:block!important;position:absolute;top:22px!important;bottom:auto!important;height:16px!important;min-width:22px!important;border-radius:8px!important;background:var(--matiere)!important;pointer-events:none!important}
html.p191-mobile #p196Minimap .p201-map-label{position:absolute;left:10px;top:5px;font:800 10px/1 system-ui,sans-serif;color:var(--matiere);pointer-events:none}
html.p191-mobile.p196-selection #p196Minimap,html.p191-mobile.p196-placing #p196Minimap{display:none!important}
html.p191-mobile #p196Live{display:block!important;position:absolute!important;left:12px!important;bottom:10px!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important;pointer-events:none!important}
html.p191-mobile #p196Live.p196-error{width:auto!important;height:auto!important;clip-path:none!important;padding:7px!important;max-width:60%!important;background:var(--matiere)!important;color:var(--fond)!important;z-index:30!important}
/* Aides : silencieuses par défaut, ponctuelles, sans chevauchement ni fausse affordance. */
html.p191-mobile #p74Guide{display:none!important}
html.p191-mobile #p201Help:not([hidden]){display:block!important;position:absolute!important;z-index:31!important;
 padding:7px 10px!important;max-width:min(210px,calc(100% - 16px))!important;max-height:80px!important;
 border:0!important;border-radius:10px!important;background:#FFE6A3!important;color:#000!important;
 box-shadow:0 3px 10px #0003!important;font:750 12px/1.3 system-ui,sans-serif!important;
 pointer-events:none!important;user-select:none!important;white-space:normal!important}
html.p191-mobile #p201Feedback:not([hidden]){display:block!important;position:absolute!important;z-index:30!important;padding:6px 10px!important;
 max-width:min(240px,calc(100% - 16px))!important;border-radius:9px!important;background:var(--matiere)!important;color:var(--fond)!important;
 font:800 12px/1.2 system-ui,sans-serif!important;pointer-events:none!important}
html.p191-mobile body.p53-editing #p53Context{pointer-events:none!important}
html.p191-mobile body.p53-editing #p53Context button{pointer-events:auto!important;touch-action:none!important;min-width:44px!important;min-height:44px!important}
/* Mode jeu : le terrain reste visible, aucune barre d'atelier et aucun écran noir par héritage CSS. */
html.p191-mobile body.p53-playing #app .workspace{grid-template-rows:var(--p201-top) minmax(0,1fr) var(--p201-play-dock)!important}
html.p191-mobile body.p53-playing #p53Tools,html.p191-mobile body.p53-playing #p62RobotDock,
html.p191-mobile body.p53-playing #p196More,html.p191-mobile body.p53-playing #p196Minimap,
html.p191-mobile body.p53-playing #p201Help,html.p191-mobile body.p53-playing #p201Feedback,
html.p191-mobile body.p53-playing #p74Guide{display:none!important}
html.p191-mobile body.p53-playing #p53Top .p53-top-actions>:not(#p53Test){display:none!important}
html.p191-mobile body.p53-playing #p53Test{display:flex!important}
html.p191-mobile body.p53-playing #p190ScoreSlot{display:flex!important;min-width:0!important;max-width:55%!important;overflow:hidden!important}
html.p191-mobile body.p53-playing #p190ScoreSlot #chronoHud{position:static!important;display:flex!important;align-items:center!important;gap:6px!important}
html.p191-mobile body.p53-playing #p190ScoreSlot .chrono-best-holder,html.p191-mobile body.p53-playing #p190ScoreSlot .chrono-current-label,html.p191-mobile body.p53-playing #p190ScoreSlot .chrono-best-label{display:none!important}
html.p191-mobile body.p53-playing #p190ScoreSlot .chrono-current-time{font-size:18px!important}
html.p191-mobile body.p53-playing #touchPad:not([hidden]){position:fixed!important;z-index:95!important;left:max(10px,env(safe-area-inset-left))!important;
 right:max(10px,env(safe-area-inset-right))!important;bottom:calc(7px + env(safe-area-inset-bottom))!important;
 width:auto!important;height:70px!important;max-width:none!important;margin:0!important;padding:0!important;
 display:flex!important;justify-content:space-between!important;align-items:center!important;pointer-events:none!important;touch-action:none!important}
html.p191-mobile body.p53-playing #touchPad button{display:flex!important;align-items:center!important;justify-content:center!important;
 width:64px!important;height:64px!important;min-width:64px!important;min-height:64px!important;
 pointer-events:auto!important;touch-action:none!important}
/* Telephone paysage court : même ossature, pas de catalogue ou bandeau ordinateur permanents. */
html.p191-mobile[data-p201-profile="phone-landscape"]{--p201-top:46px;--p201-dock:56px;--p201-play-dock:62px}
html.p191-mobile[data-p201-profile="phone-landscape"] #p53Top .p53-brand{max-width:112px!important}
html.p191-mobile[data-p201-profile="phone-landscape"] #p53Save{min-width:82px!important}
html.p191-mobile[data-p201-profile="phone-landscape"] #p62RobotDock #robotTest{max-width:150px!important}
html.p191-mobile[data-p201-profile="phone-landscape"] #p53Tools.p60-palette{height:min(245px,calc(100% - var(--p201-top) - var(--p201-dock)))!important}
/* Tablettes : une présentation tactile spacieuse ; le moteur et la géométrie restent uniques. */
html.p191-mobile[data-p201-profile="tablet"]{--p201-top:64px;--p201-dock:74px;--p201-play-dock:76px;--p201-gutter:14px}
html.p191-mobile[data-p201-profile="tablet"] #p53Top .p53-brand{max-width:160px!important;flex-basis:160px!important}
html.p191-mobile[data-p201-profile="tablet"] #p53Save{font-size:15px!important}
html.p191-mobile[data-p201-profile="tablet"] #p53Test{min-width:110px!important;font-size:15px!important}
html.p191-mobile[data-p201-profile="tablet"] #p53Tools.p60-palette{height:275px!important}
@media (max-width:360px){html.p191-mobile #p53Top .p53-brand{flex-basis:65px!important;min-width:65px!important}
 html.p191-mobile #p53Save{font-size:12px!important;min-width:66px!important}
 html.p191-mobile #p53Test{min-width:64px!important;padding:0 7px!important}}
@media (prefers-reduced-motion:reduce){html.p191-mobile #p53Tools.p60-palette{transition:none!important}}
