/* Atelier — Loto. Les moteurs de jeu restent locaux ; les panneaux de préparation utilisent le composant commun. */
.artwork-loto { background:linear-gradient(140deg,#e3f0df,#f1ebd0 80%); }
#view-loto .memory-setup-heading {margin-bottom:14px;}
/* Préparation harmonisée : bibliothèque, feuille au format configuré et réglages sans écran intermédiaire. */
#view-loto:not([hidden]){display:flex;flex-direction:column;height:100%;min-height:0}
.loto-config{flex:1 1 auto;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.loto-workspace{display:grid;gap:12px;flex:1 1 auto;min-height:0;overflow:hidden}
.loto-settings{display:flex;flex-direction:column;align-items:stretch;gap:9px}
.loto-settings-panel .memory-version{width:100%;margin-top:10px}
.loto-settings-panel [data-loto-panel][hidden]{display:none!important}
.loto-mode-explanation{margin:7px 0 0;color:#536a78;font-size:12px;line-height:1.45}
#loto-prep-board{width:960px;min-height:680px;position:relative}
.loto-prep-sheet{width:960px;height:679px;background:#fff;box-shadow:0 2px 16px #1f354522;display:flex;align-items:center;justify-content:center;box-sizing:border-box}
#loto-prep-preview{width:100%;height:100%;display:flex;align-items:center;justify-content:center}
.loto-prep-pager{display:flex;justify-content:center;gap:8px;padding:6px;background:white}
.loto-prep-pager button:disabled{opacity:.35}
.loto-prep-placeholder{background:#fff;border:1px dashed #91a3a9}
.loto-cell-options {display:flex;align-items:center;gap:4px;background:#f2f6f6;padding:4px;border-radius:11px;}
.loto-cell-options button {border:0;border-radius:8px;background:transparent;min-width:42px;min-height:32px;font:inherit;font-size:13px;font-weight:700;color:#48647b;cursor:pointer;}
.loto-cell-options button[aria-pressed="true"] {background:white;box-shadow:0 1px 4px #31495922;color:#153750;}
.loto-screen {flex:1 1 auto;min-height:0;}
body.el-memory-immersive #view-loto {height:100%;display:flex;flex-direction:column;min-height:0;}
body.el-memory-immersive #view-loto .memory-setup-heading {display:none;}
body.el-memory-immersive #loto-online:not([hidden]), body.el-memory-immersive #loto-paper:not([hidden]) {display:flex;flex-direction:column;gap:8px;}
.loto-play-area {flex:1 1 auto;display:grid;grid-template-columns:minmax(160px,235px) minmax(0,1fr);gap:14px;min-height:0;overflow:hidden;}
.loto-draw-panel {min-height:0;background:#fff;border:1px solid #e2e8e7;border-radius:16px;padding:13px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;}
.loto-draw-label {font-size:13px;font-weight:700;}
.loto-drawn-card {width:min(100%,170px);aspect-ratio:1;border:2px solid #e7e8e2;border-radius:14px;background:#f7f5e9;display:grid;place-items:center;overflow:hidden;padding:9px;color:#546f7f;font-size:15px;font-weight:700;text-align:center;}
.loto-drawn-card img {width:100%;height:100%;object-fit:contain;}
.loto-draw-button {width:100%;max-width:200px;}
.loto-play-message {min-height:20px;font-size:11px;line-height:1.4;color:#546779;text-align:center;margin:0;}
.loto-boards-area {min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;}
.loto-boards {display:grid;gap:12px;width:100%;height:100%;min-height:0;align-items:center;justify-items:center;}
.loto-board {width:100%;height:100%;min-width:0;min-height:0;display:flex;flex-direction:column;gap:5px;align-items:center;justify-content:center;overflow:hidden;}
.loto-grid {display:grid;grid-template-columns:repeat(var(--loto-cols,3),minmax(0,1fr));grid-template-rows:repeat(var(--loto-rows,2),minmax(0,1fr));gap:5px;flex:1 1 auto;width:100%;min-width:0;min-height:0;}
.loto-square {border:2px solid #d8e0dd;background:white;border-radius:10px;display:grid;place-items:center;padding:5px;position:relative;overflow:hidden;cursor:pointer;min-width:0;min-height:0;}
.loto-square img {width:100%;height:100%;object-fit:contain;}
.loto-square:disabled {cursor:default;}
.loto-square.is-marked {background:#ecf6e9;border-color:#80b18c;}
.loto-square.is-marked:after {content:"✓";position:absolute;right:5px;top:3px;display:grid;place-items:center;width:23px;height:23px;border-radius:50%;color:#fff;background:#4c9d74;font-weight:700;box-shadow:0 1px 4px #17492a36;}
.loto-square.is-wrong {border-color:#c57768;animation:loto-wrong .3s linear;}
@keyframes loto-wrong{50%{transform:translateX(3px);}}
/* Aperçu A4 paysage : même agencement et mêmes proportions que l'impression. */
.loto-paper-sheet {width:100%;aspect-ratio:var(--loto-paper-ratio,297/210);background:white;box-shadow:0 5px 22px #1c33431c;flex:0 0 auto;padding:0;display:grid;place-items:center;}
#loto-paper-preview {display:flex;align-items:center;justify-content:center;width:100%;height:100%;}
.loto-print-board,.loto-draw-sheet {width:100%;height:100%;display:flex;align-items:center;justify-content:center;min-height:0;}
.loto-print-tiles,.loto-print-picks {display:grid;grid-template-columns:repeat(var(--loto-cols),minmax(0,1fr));grid-template-rows:repeat(var(--loto-rows),minmax(0,1fr));width:var(--loto-preview-width);height:var(--loto-preview-height);gap:var(--loto-preview-gap-y,1.4%) var(--loto-preview-gap-x,1.4%);min-height:0;flex:none;}
.loto-editable-cell{cursor:pointer;outline-offset:2px;}
.loto-editable-cell:focus-visible{outline:2px solid #007eb5;}
.loto-editable-cell:hover{border-color:#007eb5;background:#f4fbff;}
.loto-print-tiles > div,.loto-print-pick-item {display:grid;place-items:center;border:1px dashed #aab7b7;padding:3%;min-width:0;min-height:0;overflow:hidden;}
.loto-print-tiles img,.loto-print-pick-item img {max-width:100%;max-height:100%;width:100%;height:100%;object-fit:contain;}
@media(max-width:850px){.loto-settings{justify-content:space-evenly;}}
@media(max-width:650px){.loto-play-area{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);gap:6px;}.loto-draw-panel{flex-direction:row;padding:6px;gap:7px;justify-content:space-around;flex-wrap:wrap;}.loto-draw-label,.loto-draw-panel .loto-mini-hint{display:none;}.loto-drawn-card{width:67px;height:67px;aspect-ratio:1;padding:3px;font-size:10px;}.loto-draw-button{max-width:180px;}.loto-play-message{flex:1 1 85px;min-width:50px;text-align:left;}.loto-boards{display:grid;}.loto-board{height:100%;}}
@media(max-width:390px){.loto-settings{gap:8px;}.loto-cell-options button{min-width:32px;}.loto-drawn-card{width:58px;height:58px;}.loto-draw-button{max-width:120px;}}
@media(max-height:480px){.loto-draw-panel{padding:5px;}.loto-drawn-card{height:65px;width:65px;}.loto-play-area{grid-template-columns:minmax(112px,160px) minmax(0,1fr);grid-template-rows:1fr;}.loto-draw-panel{flex-direction:column;flex-wrap:nowrap;}}
/* Sélection cumulative d'histoires et identification explicite des joueurs. */
.loto-album-picked {display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 8px;max-height:98px;overflow-y:auto;}
.loto-album-chip {display:flex;align-items:center;gap:6px;max-width:270px;background:#f4f8f7;border:1px solid #d6e3e0;padding:3px 6px;border-radius:9px;min-height:35px;}
.loto-album-chip img {height:28px;width:24px;object-fit:contain;flex:none;}
.loto-album-chip-name {font-size:11px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.loto-album-chip button {border:0;background:transparent;color:#546779;font-size:19px;cursor:pointer;padding:0 3px;flex:none;}


/* Loto des histoires : deux formats, réglage de pioche après génération. */




.loto-pile-panel {padding-top:13px;margin-top:13px;border-top:1px solid #e7eeee;}
.loto-pile-header {display:flex;align-items:center;justify-content:space-between;gap:12px;}
.loto-pile-header h2 {margin:0;}
.loto-pile-header strong {font-size:15px;color:#214c66;}
#loto-pile-slider {width:100%;accent-color:#315d75;cursor:pointer;margin:10px 0 4px;}
.loto-pile-range {display:flex;justify-content:space-between;color:#687d8c;font-size:11px;}
#loto-pile-explanation {margin:7px 0;}
.loto-pile-panel .loto-actions {margin-top:8px;}
.loto-paper-tabs {display:flex;gap:7px;justify-content:center;flex:0 0 auto;}
.loto-paper-tabs button {border:1px solid #d9e4e4;background:#fff;color:#446173;font:inherit;font-size:11px;font-weight:700;border-radius:10px;padding:7px 14px;cursor:pointer;}
.loto-paper-tabs button[aria-pressed="true"] {border-color:#648da1;background:#eaf2f6;color:#143a52;}
.loto-draw-sheet {display:flex;flex-direction:column;width:100%;height:100%;min-height:0;}
@media(max-width:650px){.loto-settings{gap:9px;}.loto-paper-tabs button{flex:1;}.loto-pile-panel .loto-actions button{width:100%;}}



.loto-absent{width:100%;max-width:200px;border-color:#c9d8dd;}
@media(max-width:720px){}
@media(max-width:650px){.loto-absent{max-width:180px;}.loto-draw-panel{justify-content:center;}}
@media(prefers-reduced-motion:reduce){}

#view-loto .loto-settings-content h2:first-child{padding-left:28px;min-height:22px}

.loto-resource-caption{font-size:10px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.loto-gallery-label{grid-column:1/-1}
