/* Memory — éditeur classique, construit à partir des vrais contrôles du jeu.
   Les modes "jouer" et "papier" conservent leurs règles d'origine. */
#view-memory #memory-config.ef-memory-editor-host{display:block;width:100%;min-width:0}
#view-memory .ef-memory-workspace{display:grid;grid-template-columns:var(--ef-library-width) minmax(0,1fr) var(--ef-parameters-width);gap:var(--ef-activity-gap);height:calc(100dvh - 135px);min-height:0;align-items:stretch}
#view-memory .ef-memory-library,#view-memory .ef-memory-preview,#view-memory .ef-memory-settings{border:1px solid #eadcc7;border-radius:var(--ef-activity-radius);background:#fff;min-width:0;min-height:0}
#view-memory .ef-memory-library{display:flex;flex-direction:column;padding:12px 10px;overflow:hidden}
#view-memory .ef-memory-library-head{display:flex;justify-content:space-between;gap:6px;align-items:center;padding:0 0 9px 2px}
#view-memory .ef-memory-library-head h2{font-size:15px;margin:0;font-weight:800}
#view-memory .ef-memory-sources{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;padding-bottom:13px}
#view-memory .ef-memory-source{display:grid;place-items:center;min-width:0;height:39px;background:#fff;color:#163b55;border:1px solid #d4e0e7;border-radius:10px;cursor:pointer;padding:7px 5px}
#view-memory .ef-memory-source[aria-pressed="true"]{background:#ffca36;border-color:#eba700}
#view-memory .ef-memory-source svg{width:24px;height:24px;max-width:100%;display:block}
#view-memory .ef-memory-library-body{overflow:auto;min-height:0;flex:1;padding:3px}
#view-memory .ef-memory-legacy-album{display:none!important}
#view-memory .ef-memory-library>.ef-editor-story-select{margin:6px 2px 12px}
#view-memory .memory-source-tabs[hidden],#view-memory .memory-picto-selected[hidden],#view-memory .memory-picto-selected-heading[hidden]{display:none!important}
#view-memory #memory-config-bar{display:block;margin:0!important}
#view-memory #memory-config-bar .memory-setup-album{padding:5px 0 11px;border:0;border-radius:0;box-shadow:none}
#view-memory .memory-setup-album h2{font-size:12px}
#view-memory .memory-search{width:100%;font-size:12px;max-width:none}
#view-memory #memory-config-bar .memory-album-picker.is-browsing{position:static;overflow:visible;box-shadow:none;border:0;padding:0;max-width:none;max-height:none}
#view-memory #memory-albums.album-grid{display:flex;flex-direction:column;gap:5px}
#view-memory #memory-albums .album-tile{min-height:53px;padding:6px;display:flex;align-items:center;gap:7px}
#view-memory #memory-albums .album-tile img{width:35px;height:42px;object-fit:cover}
#view-memory #memory-albums .album-title{font-size:11px}
#view-memory #memory-cards,#view-memory #memory-picto-results{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;min-width:0}
#view-memory #memory-cards[hidden],#view-memory #memory-picto-select[hidden]{display:none!important}
#view-memory #memory-cards .memory-resource,#view-memory #memory-picto-results .memory-resource{padding:5px 3px;min-width:0}
#view-memory #memory-cards .memory-resource img,#view-memory #memory-picto-results .memory-resource img{height:68px;width:100%;object-fit:contain;background:#fff}
#view-memory .memory-resource-label{white-space:normal;overflow-wrap:anywhere;font-size:10px;line-height:1.2}
#view-memory .ef-memory-preview{display:flex;flex-direction:column;padding:14px;gap:9px;overflow:hidden}
#view-memory .ef-memory-preview-head{display:flex;gap:10px;justify-content:space-between;align-items:center;font-size:12px}
#view-memory .ef-memory-preview-count{color:#607484;font-size:11px}
#view-memory .ef-memory-preview-pager{display:flex;gap:6px;align-items:center;margin-left:auto}
#view-memory .ef-memory-page-label{font-size:11px;color:#17364b;white-space:nowrap}
#view-memory .ef-memory-page-button{width:26px;height:26px;background:#fff;border:1px solid #d5dfe5;border-radius:7px;color:#17364b;cursor:pointer;font-size:18px;line-height:1}
#view-memory .ef-memory-page-button:disabled{opacity:.35;cursor:default}
#view-memory .ef-memory-preview-stage{display:flex;flex:1;min-height:0;align-items:center;justify-content:center;overflow:auto;background:#f0f3f4;border-radius:15px;padding:12px}
#view-memory .ef-memory-sheet{flex:0 1 auto;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:min(96%,580px);aspect-ratio:297 / 210;background:#fff;padding:3.37%;box-shadow:0 3px 14px #14324b15}
/* Dimensions et nombre de cartes issus du plan physique partagé. */
#view-memory .ef-memory-preview-cards{display:grid;align-content:center;justify-content:center;min-width:0;min-height:0}
#view-memory .ef-memory-sheet-card{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;aspect-ratio:1;background:#fff;border:1px solid #d5dfe5;border-radius:4px;padding:5px;cursor:pointer;overflow:hidden}
#view-memory .ef-memory-card-picture:hover,#view-memory .ef-memory-card-picture:focus-visible{outline:2px solid #078fe0;outline-offset:0}
#view-memory .ef-memory-sheet-card.is-selected{outline:2px solid #078fe0;outline-offset:0;border-color:#078fe0}
#view-memory .ef-memory-sheet-card .ef-caa-layers{width:100%;height:100%}
#view-memory .ef-memory-sheet-empty{color:#9aa9b8;font-size:11px;text-align:center;border-style:dashed;cursor:default}
#view-memory .ef-memory-preview-hint{margin:0;color:#566f7e;font-size:11px;text-align:center}
/* La barre commune reste une rangée incompressible sous le support. */
#view-memory .ef-memory-preview>.ef-zoom-toolbar{display:flex;flex:0 0 38px;height:38px;min-height:38px;order:2}
#view-memory .ef-memory-preview>.ef-memory-preview-hint{order:3;flex:0 0 auto}
#view-memory .ef-memory-preview>.ef-memory-preview-stage{order:1;flex:1 1 0;min-height:0}
#view-memory .ef-memory-settings{display:grid;grid-template-columns:minmax(0,1fr) var(--ef-rail-width);overflow:hidden}
#view-memory .ef-memory-settings-main{padding:18px 13px;min-width:0;min-height:0;overflow:auto}
#view-memory .ef-memory-settings-main h2{margin:0 0 15px;font-size:15px;color:#17364b}
#view-memory .ef-memory-settings-section{display:flex;flex-direction:column;gap:12px;font-size:12px;color:#24445a}
#view-memory .ef-memory-settings-section[hidden]{display:none!important}
#view-memory .ef-memory-settings-section h3{font-size:13px;border-bottom:1px solid #e8c88a;padding-bottom:8px;margin:0}
#view-memory .ef-memory-settings-section p{font-size:12px;margin:0;line-height:1.55}
#view-memory .ef-memory-layout-modes{display:grid;grid-template-columns:1fr 1fr;gap:5px}
#view-memory .ef-memory-layout-modes button{border:1px solid #d1dfe7;border-radius:9px;padding:8px 3px;background:#fff;font-weight:700;color:#17364b;cursor:pointer}
#view-memory .ef-memory-layout-modes button[aria-pressed="true"]{background:#ffca36;border-color:#e3a500}
#view-memory .ef-memory-layout-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
#view-memory .ef-memory-layout-fields[hidden]{display:none!important}
#view-memory .ef-memory-layout-field{display:flex;flex-direction:column;gap:5px;min-width:0;color:#24445a;font-weight:600;font-size:11px}
#view-memory .ef-memory-layout-field select,#view-memory .ef-memory-layout-field input{box-sizing:border-box;min-height:35px;width:100%;min-width:0;padding:7px;border:1px solid #d1dfe7;border-radius:8px;background:#fff;color:#17364b;font:inherit}
#view-memory .ef-memory-layout-summary{padding:10px;border-radius:9px;background:#f0f5f8;font-weight:650}
#view-memory .ef-memory-layout-error{color:#a72330;font-weight:650}
#view-memory .ef-memory-layout-error:empty{display:none}
#view-memory .ef-memory-layout-help{color:#607484}
#view-memory .ef-memory-settings-section #memory-pairs-step{display:block!important;padding:0;border:0}
#view-memory .ef-memory-settings-section #memory-pairs-step[hidden]{display:none!important}
#view-memory .ef-memory-settings-section .memory-turn-choice{max-width:none}
#view-memory .ef-memory-settings-section .memory-version{width:100%;min-height:43px}
#view-memory .ef-memory-status{margin-top:12px;color:#657e8d;font-size:11px}
#view-memory .ef-memory-status>*{display:block;min-height:0;margin:3px 0}
#view-memory .ef-memory-rail{display:flex;flex-direction:column;align-items:center;gap:6px;border-left:1px solid #f0e2cc;background:#fffaf1;padding:8px 4px}
#view-memory .ef-memory-rail-button{width:40px;height:40px;display:grid;place-items:center;background:#fff;color:#173b54;border:1px solid #e7d6b6;border-radius:10px;padding:0;cursor:pointer}
#view-memory .ef-memory-rail-button[aria-pressed="true"]{background:#ffca36;border-color:#e3a500}
#view-memory .ef-memory-rail-divider{height:1px;background:#e5d7c1;width:35px;margin:4px 0}
#view-memory .ef-memory-reader-status{margin:12px 0;color:#486f82;font-size:11px}
#view-memory .ef-memory-editor-host .memory-setup-cards[hidden]{display:none!important}
#view-memory .ef-memory-editor-host #memory-picto-select .memory-picto-selected-heading{display:none!important}

@media(max-width:800px){#view-memory .ef-memory-preview-head{flex-wrap:wrap}#view-memory .ef-memory-preview-pager{margin-left:0}#view-memory .ef-memory-workspace{height:auto;min-height:0;display:flex;flex-direction:column}#view-memory .ef-memory-preview{order:0}#view-memory .ef-memory-library{order:1}#view-memory .ef-memory-settings{order:2}#view-memory .ef-memory-library{max-height:370px}#view-memory .ef-memory-preview{min-height:420px}#view-memory .ef-memory-settings{min-height:280px}#view-memory .ef-memory-preview-stage{min-height:360px}#view-memory .ef-memory-sheet{max-width:400px}}
@media print{#view-memory #memory-config.ef-memory-editor-host{display:none!important}}

/* La structure de configuration historique a été vidée : ne jamais l'afficher. */
#view-memory #memory-config > #memory-cards-step{display:none!important}
#view-memory #memory-switch-source{display:none!important}
/* Même occupation de la page que les autres éditeurs de supports. */
body:not(.el-memory-immersive):has(#view-memory:not([hidden]):not(.ef-game-intro-active)) > main{width:100%;max-width:none;padding:8px 12px 12px}

#view-memory .ef-memory-card-picture{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center;border:0;background:#fff;border-radius:4px;cursor:pointer;padding:0}
#view-memory .ef-memory-card-picture .ef-caa-layers{width:100%;height:100%}

/* Memory, édition classique sur ordinateur : tout l'atelier tient dans la
   fenêtre visible. Les bibliothèques et paramètres seuls défilent si besoin.
   L'éditeur individuel canonique et les modes plein écran restent intacts. */
@media (min-width:801px){
  body:not(.el-memory-immersive):has(#view-memory:not([hidden]):not(.ef-game-intro-active)) > main{
    height:100dvh;min-height:0;overflow:hidden;
    display:flex;flex-direction:column;padding:8px 12px 10px;
  }
  #view-memory:not([hidden]):not(.ef-game-intro-active):not(:fullscreen){
    display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden;gap:8px;
  }
  #view-memory:not(:fullscreen)>.memory-setup-heading{flex:0 0 auto;margin-bottom:0}
  #view-memory:not(:fullscreen) #memory-config.ef-memory-editor-host{
    flex:1 1 auto;min-height:0;overflow:hidden;display:flex;
  }
  #view-memory:not(:fullscreen) .ef-memory-workspace{
    flex:1 1 auto;height:auto;min-height:0;overflow:hidden;
  }
  #view-memory:not(:fullscreen) .ef-memory-preview-stage.ef-work-viewport{
    display:flex;align-items:center;justify-content:center;min-height:0;
  }
  #view-memory:not(:fullscreen) .ef-memory-preview .ef-zoom-toolbar{
    flex:0 0 38px;
  }
}

/* Règle 13, Memory : réutiliser le plein écran commun à la place d'une
   disposition alternative. Aucun changement aux autres ateliers. */
#view-memory.ef-fs-editor:not(.ef-canonical-active):not(.ef-game-intro-active):fullscreen #memory-config.ef-memory-editor-host{display:flex!important;flex:1 1 auto!important;min-height:0!important;overflow:hidden!important}
#view-memory.ef-fs-editor:not(.ef-canonical-active):fullscreen .ef-memory-workspace{flex:1 1 auto!important;width:100%;height:100%!important;min-height:0!important;overflow:hidden!important}
.ef-memory-preview.ef-fs-preview:fullscreen .ef-memory-preview-stage{flex:1 1 auto!important;min-height:0!important;overflow:auto!important}

