/* =========================================================================
   ImmersiClasse — multijoueur : session, classe, chat, activités
   ========================================================================= */
#mp-root { position: fixed; inset: 0; z-index: 14; pointer-events: none; }
#mp-root > * { pointer-events: auto; }

/* pastille dans la barre du haut */
.mp-badge .mp-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(19, 138, 75, .2); flex: none; }
.mp-badge.warn .mp-dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(178, 106, 0, .22); }
.mp-badge .lbl { font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: .04em; }

#mp-banner { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); padding: 7px 16px; color: var(--warn); font-weight: 650; font-size: .88rem; }

/* panneau latéral */
#mp-panel { position: absolute; top: 64px; right: 14px; bottom: 14px; width: min(410px, calc(100vw - 28px)); display: flex; flex-direction: column; background: var(--glass); border: 1px solid var(--glass-line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); overflow: hidden; animation: fade-in .18s ease; }
.mp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 8px; }
.mp-title { display: grid; line-height: 1.25; }
.mp-title small { color: var(--muted); font-size: .78rem; }
.mp-tabs { display: flex; gap: 4px; padding: 0 10px 8px; border-bottom: 1px solid var(--line); }
.mp-tab { flex: 1; padding: 7px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 650; font-size: .84rem; cursor: pointer; }
.mp-tab:hover { background: var(--surface3); color: var(--text); }
.mp-tab.on { background: var(--accent-soft); color: var(--accent); }
.mp-pane { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.mp-pane h4 { margin: 8px 0 -2px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.mp-foot { margin-top: auto; padding-top: 6px; display: flex; justify-content: center; }

/* classe */
.mp-roster { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mp-row { display: flex; align-items: center; gap: 9px; padding: 6px 6px; border-radius: 10px; }
.mp-row:hover { background: var(--surface3); }
.mp-row.off { opacity: .5; }
.mp-row.hand { background: var(--warn-soft); }
.mp-ava { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 750; font-size: .85rem; background: var(--surface3); color: var(--text2); }
.mp-ava.r-host { background: var(--accent); color: #fff; } .mp-ava.r-mod { background: var(--accent-soft2); color: var(--accent-h); }
.mp-who { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.mp-who b { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-who small { color: var(--muted); font-size: .72rem; }
.mp-who small:empty { display: none; }
.mp-hand { font-size: 1.05rem; animation: mp-wave 1s ease-in-out infinite; }
@keyframes mp-wave { 50% { transform: rotate(14deg); } }
.mp-pts { font-variant-numeric: tabular-nums; font-weight: 750; font-size: .8rem; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.mp-acts { display: none; gap: 1px; }
.mp-row:hover .mp-acts { display: flex; }
.mp-ic { border: 0; background: transparent; width: 26px; height: 26px; border-radius: 7px; cursor: pointer; font-size: .85rem; line-height: 1; }
.mp-ic:hover { background: var(--surface); box-shadow: var(--shadow-xs); }
.mp-ic.on { background: var(--danger-soft); }
.mp-react { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; }
.mp-emoji { border: 0; background: transparent; font-size: 1.25rem; cursor: pointer; border-radius: 8px; padding: 2px 4px; transition: transform .12s; }
.mp-emoji:hover { transform: scale(1.3); background: var(--surface3); }

/* chat */
.mp-log { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; padding-bottom: 4px; }
.mp-msg { line-height: 1.35; word-break: break-word; }
.mp-msg b { color: var(--accent-h); }
.mp-msg.teach b { color: #8a3b00; }
.mp-msg i { color: var(--muted); font-size: .76rem; font-style: normal; }
.mp-msg.priv { background: var(--warn-soft); border-radius: 8px; padding: 3px 7px; }
.mp-chat-form { display: flex; gap: 6px; align-items: center; }
.mp-chat-form input { flex: 1; min-width: 0; padding: 8px 10px; border: 1.5px solid var(--line2); border-radius: 10px; background: var(--field); outline: none; }
.mp-chat-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.mp-priv.on { background: var(--warn-soft); border-color: var(--warn); }

/* chat toujours à portée : bulles récentes + « Écrire… » en bas à gauche (au-dessus de la mini-carte) */
#mp-mini { position: absolute; left: 14px; bottom: 262px; width: min(400px, calc(100vw - 28px)); display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
#mp-chatpill { position: absolute; left: 14px; bottom: 216px; display: inline-flex; align-items: center; gap: 9px; max-width: min(400px, calc(100vw - 28px)); padding: 8px 10px 8px 14px; border-radius: 999px; border: 1px solid var(--glass-line); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow); color: var(--text2); font: inherit; font-size: .86rem; cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s; }
#mp-chatpill:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); color: var(--text); }
#mp-chatpill .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mp-chatpill kbd { font: 700 .72rem/1 system-ui, sans-serif; padding: 4px 8px; border-radius: 7px; background: var(--surface3); border: 1px solid var(--line2); color: var(--muted); }
#mp-chatpill.dim { opacity: .6; } #mp-chatpill.dim kbd { display: none; }
#mp-chatpill.flash { background: var(--accent); color: #fff; border-color: var(--accent); animation: mp-pulse 1.4s ease-in-out infinite; } #mp-chatpill.flash kbd { background: rgba(255,255,255,.2); border-color: transparent; color: #fff; }
@keyframes mp-pulse { 50% { box-shadow: 0 0 0 7px var(--accent-ring); } }
#mp-mini.open { bottom: 262px; }
#mp-mini .mp-chat-form { position: absolute; left: 0; right: 0; bottom: -46px; }
#mp-mini .mp-msg { align-self: flex-start; max-width: 100%; background: rgba(22, 26, 37, .72); color: #fff; padding: 5px 10px; border-radius: 12px; font-size: .84rem; text-shadow: none; animation: fade-in .2s; }
#mp-mini .mp-msg b { color: #9fe3ee; } #mp-mini .mp-msg.teach b { color: #ffd08a; } #mp-mini .mp-msg i { color: #c7ccd8; }
#mp-mini .mp-chat-form { pointer-events: auto; background: var(--glass); padding: 6px; border-radius: 14px; box-shadow: var(--shadow); }

/* pilotage */
.mp-share { display: flex; gap: 12px; align-items: center; background: var(--accent-soft); border-radius: var(--r); padding: 10px 12px; }
.mp-code { font-size: 1.9rem; font-weight: 800; letter-spacing: .12em; color: var(--accent-h); font-variant-numeric: tabular-nums; }
.mp-share > div:last-child { flex: 1; min-width: 0; }
.mp-share small { color: var(--muted); display: block; line-height: 1.3; margin-bottom: 6px; }
.mp-link { display: flex; gap: 6px; } .mp-link input { flex: 1; min-width: 0; font-size: .74rem; padding: 5px 8px; border: 1px solid var(--line2); border-radius: 8px; background: #fff; }
.mp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mp-grid .btn { justify-content: center; min-width: 0; white-space: normal; text-align: center; }
.mp-toggle { display: flex; align-items: center; gap: 8px; font-size: .86rem; cursor: pointer; }
.mp-toggle select { flex: 1; padding: 5px 8px; border: 1px solid var(--line2); border-radius: 8px; background: #fff; }
.mp-note { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); background: var(--surface3); padding: 8px 10px; border-radius: 10px; }

/* bulles et réactions au-dessus des têtes */
#mp-chips { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.mp-chip { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; will-change: transform; }
.mp-chip .say { max-width: 230px; padding: 6px 11px; border-radius: 13px; background: #fff; color: #1d1b18; font: 600 13px/1.3 system-ui, sans-serif; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); text-align: center; word-break: break-word; position: relative; }
.mp-chip .say::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
.mp-chip .hand { font-size: 1.6rem; animation: mp-wave 1s ease-in-out infinite; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3)); }
.mp-chip .react { font-size: 2.1rem; animation: mp-float 2.6s ease-out forwards; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3)); }
@keyframes mp-float { 0% { transform: translateY(8px) scale(.5); opacity: 0; } 15% { transform: translateY(0) scale(1.15); opacity: 1; } 100% { transform: translateY(-34px) scale(1); opacity: 0; } }

/* annonce de l'enseignant·e */
#mp-announce { position: absolute; left: 50%; top: 110px; transform: translate(-50%, -10px); opacity: 0; transition: .3s var(--ease); pointer-events: none; background: rgba(15, 107, 122, .96); color: #fff; border-radius: 16px; padding: 12px 26px; text-align: center; max-width: min(640px, 90vw); box-shadow: var(--shadow-lg); }
#mp-announce.on { opacity: 1; transform: translate(-50%, 0); }
#mp-announce small { display: block; opacity: .8; font-weight: 600; letter-spacing: .04em; }
#mp-announce div { font-size: 1.35rem; font-weight: 750; line-height: 1.25; }

/* carte d'activité */
#mp-activity { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); width: min(560px, calc(100vw - 400px)); min-width: 300px; max-height: calc(100vh - 130px); overflow: auto; padding: 16px 18px; border-radius: var(--r-lg);
  background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--shadow-lg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); display: flex; flex-direction: column; gap: 10px; animation: fade-in .2s ease; }
#mp-activity h3 { margin: 0; font-size: 1.15rem; line-height: 1.3; padding-right: 26px; }
#mp-activity small { color: var(--muted); }
.mp-x { position: absolute; top: 8px; right: 8px; }
.mp-qhead { padding-right: 30px; display: flex; justify-content: space-between; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mp-timer { font-variant-numeric: tabular-nums; font-size: 1rem; color: var(--accent); } .mp-timer.low { color: var(--danger); animation: mp-wave .5s infinite; }
.mp-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mp-choice { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 2px solid transparent; border-radius: 12px; color: #fff; font-weight: 650; font-size: .95rem; text-align: left; cursor: pointer; transition: transform .1s, filter .15s; }
.mp-choice b { background: rgba(255, 255, 255, .25); border-radius: 7px; padding: 0 7px; }
.mp-choice:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.mp-choice:disabled { opacity: .55; cursor: default; } .mp-choice.mine { opacity: 1; border-color: #1d1b18; box-shadow: 0 0 0 3px rgba(255, 255, 255, .8) inset; }
.mp-choice.c0 { background: #d9480f; } .mp-choice.c1 { background: #1c7ed6; } .mp-choice.c2 { background: #2f9e44; } .mp-choice.c3 { background: #9c36b5; }
.mp-bars { display: flex; flex-direction: column; gap: 6px; }
.mp-bar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 11px; border-radius: 10px; background: var(--surface3); overflow: hidden; font-size: .9rem; }
.mp-bar .fill { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft2); transition: width .35s var(--ease); }
.mp-bar .lab, .mp-bar b { position: relative; } .mp-bar.mine { outline: 2px solid var(--accent); } .mp-bar.good .fill { background: #b7e4c7; } .mp-bar.good { outline: 2px solid var(--ok); }
.mp-answers { margin: 0; padding: 0; list-style: none; max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.mp-answers li { background: var(--surface3); padding: 5px 10px; border-radius: 9px; } .mp-answers b { color: var(--accent-h); }
.mp-buzz { padding: 22px; border: 0; border-radius: 18px; background: #d92d43; color: #fff; font-size: 1.8rem; font-weight: 850; letter-spacing: .06em; cursor: pointer; box-shadow: 0 8px 0 #a31d30; transition: transform .08s, box-shadow .08s; }
.mp-buzz:active:not(:disabled) { transform: translateY(6px); box-shadow: 0 2px 0 #a31d30; } .mp-buzz.pressed { background: #868e96; box-shadow: none; cursor: default; }
.mp-first { font-size: 1.05rem; } .mp-first ol { margin: 6px 0 0; padding-left: 22px; font-size: .88rem; color: var(--muted); }
.mp-verdict { text-align: center; font-weight: 750; padding: 6px; border-radius: 10px; } .mp-verdict.ok { background: var(--ok-soft); color: var(--ok); } .mp-verdict.ko { background: var(--danger-soft); color: var(--danger); }
.mp-rank { margin: 0; padding-left: 26px; display: flex; flex-direction: column; gap: 3px; font-size: .9rem; }
.mp-rank li span { display: inline-block; min-width: 150px; } .mp-rank li.me { font-weight: 750; color: var(--accent-h); } .mp-rank b { font-variant-numeric: tabular-nums; }
.mp-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* fenêtre de création d'activité */
.mp-modal { position: fixed; inset: 0; z-index: 60; background: rgba(22, 26, 37, .38); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 24px; }
.mp-dialog { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border-radius: var(--r-xl); padding: 22px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 12px; }
.mp-dialog h2 { margin: 0; font-size: 1.2rem; }
.mp-dialog label { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; font-weight: 650; color: var(--text2); }
.mp-dialog label.inl { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.mp-dialog input:not([type=checkbox]), .mp-dialog textarea { width: 100%; padding: 8px 10px; border: 1.5px solid var(--line2); border-radius: 10px; background: var(--field); font: inherit; }
.mp-dialog textarea { font-family: ui-monospace, Menlo, monospace; font-size: .84rem; resize: vertical; }
.mp-dialog small { color: var(--muted); } .mp-err { color: var(--danger); font-weight: 600; min-height: 1em; font-size: .86rem; }

/* écran de départ */
#start-session .ss-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#start-session .ss-form { display: flex; gap: 6px; margin-top: 6px; }
#start-session #ss-code, #start-session #ss-name, #start-session #ss-link { padding: 7px 10px; border: 1.5px solid var(--line2); border-radius: 9px; background: var(--field); min-width: 0; font: inherit; }
#start-session #ss-code { width: 7.4em; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; text-align: center; }
#start-session .ss-live { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); border: 1.5px solid var(--accent-line); }
#start-session .ss-big { font-size: 2.1rem; font-weight: 850; letter-spacing: .14em; color: var(--accent-h); line-height: 1; }
#start-session .ss-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#start-session .ss-line label { font-size: .84rem; font-weight: 650; }
#start-session #ss-name { flex: 1; } #start-session #ss-link { flex: 1; font-size: .75rem; }

@media (max-width: 900px) { #mp-activity { width: calc(100vw - 28px); top: 112px; } #mp-panel { top: 108px; } }
@media (prefers-reduced-motion: reduce) { .mp-hand, .mp-chip .hand, .mp-timer.low, .mp-chip .react { animation: none; } }

/* droits : matrice joueurs × droits */
.mp-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mp-presets .btn { flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; height: auto; padding: 8px 10px; white-space: normal; }
.mp-presets small { color: var(--muted); font-weight: 400; line-height: 1.25; }
.mp-matrix { width: 100%; border-collapse: collapse; font-size: .86rem; }
.mp-matrix th, .mp-matrix td { padding: 3px 2px; text-align: center; }
.mp-matrix td.who { text-align: left; display: flex; align-items: center; gap: 4px; max-width: 120px; } .mp-matrix td.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.mp-matrix td.empty { color: var(--muted); padding: 14px 4px; text-align: center; }
.mp-perm { width: 30px; height: 28px; border-radius: 8px; border: 1.5px solid transparent; cursor: pointer; font-weight: 800; font-size: .9rem; line-height: 1; background: var(--surface3); color: var(--muted); }
.mp-perm.on { background: var(--ok-soft, #e1f5ea); color: var(--ok); } .mp-perm.off { background: var(--danger-soft); color: var(--danger); }
.mp-perm.own { border-color: var(--warn); } .mp-perm.head { width: 36px; height: 32px; font-size: 1.05rem; }
.mp-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .74rem; color: var(--muted); margin: 6px 0 2px; }
.mp-hint { color: var(--muted); display: block; line-height: 1.35; }

/* chat : choix des destinataires */
.mp-chat-form { position: relative; }
.mp-priv { max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.mp-pop { position: absolute; left: 0; bottom: calc(100% + 8px); width: min(300px, 86vw); max-height: 320px; overflow: auto; z-index: 3; display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; background: var(--surface, #fff); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow-lg); pointer-events: auto; }
.mp-pop small { color: var(--muted); }
.mp-opts { display: flex; flex-direction: column; max-height: 150px; overflow: auto; }
.mp-opt { display: flex; align-items: center; gap: 8px; padding: 3px 2px; font-size: .86rem; cursor: pointer; }
.mp-dm { opacity: .5; } .mp-row:hover .mp-dm { opacity: 1; }

/* vocal */
#mp-voice { position: absolute; left: 14px; bottom: 262px; display: flex; align-items: center; gap: 6px; }
#mp-voice .mp-vbtn { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 9px; padding: 8px 12px 8px 12px; border-radius: 999px; border: 1px solid var(--glass-line); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow); color: var(--text2); font: inherit; font-size: .86rem; cursor: pointer; user-select: none; touch-action: none; }
#mp-voice .mp-vbtn:hover { color: var(--text); box-shadow: var(--shadow-lg); }
#mp-voice .mp-vbtn kbd { font: 700 .72rem/1 system-ui, sans-serif; padding: 4px 8px; border-radius: 7px; background: var(--surface3); border: 1px solid var(--line2); color: var(--muted); }
#mp-voice .mp-vbtn kbd.hidden { display: none; }
#mp-voice .meter { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--ok); transform-origin: left; transform: scaleX(0); transition: transform .08s linear; }
#mp-voice[data-state="talk"] .mp-vbtn { background: #c62f3c; border-color: #c62f3c; color: #fff; animation: mp-pulse 1.2s ease-in-out infinite; }
#mp-voice[data-state="talk"] .meter { background: rgba(255,255,255,.75); }
#mp-voice[data-state="listen"] .mp-vbtn, #mp-voice[data-state="off"] .mp-vbtn { opacity: .75; }
#mp-voice .mp-vmore { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--glass-line); background: var(--glass); box-shadow: var(--shadow); cursor: pointer; color: var(--text2); }
#mp-voice .mp-vpop { position: absolute; left: 0; bottom: 46px; width: 290px; }
#mp-voice .mp-vpop input[type=range] { flex: 1; }
.mp-chip .talk { font-size: 1.3rem; animation: mp-wave 1s ease-in-out infinite; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3)); }
.mp-talk { font-size: .95rem; animation: mp-wave 1s ease-in-out infinite; }

/* supports de cours : fenêtre de diapositives et liste des supports */
#mp-slides { position: absolute; left: 14px; bottom: 74px; width: min(46vw, 700px); display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: #14171f; color: #fff;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .14); animation: fade-in .2s ease; }
#mp-slides.big { left: 50%; bottom: auto; top: 64px; transform: translateX(-50%); width: min(94vw, 1500px); max-height: calc(100vh - 80px); }
#mp-slides .ms-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; background: rgba(255, 255, 255, .06); }
#mp-slides .ms-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
#mp-slides .ms-pick { flex: 1; min-width: 0; font: inherit; font-weight: 700; font-size: .85rem; padding: 3px 6px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: inherit; text-overflow: ellipsis; }
#mp-slides .ms-pick option { color: #111; }
#mp-slides .ms-count { font-variant-numeric: tabular-nums; font-size: .82rem; opacity: .8; margin-right: 4px; }
#mp-slides .btn { background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; }
#mp-slides .btn:hover:not(:disabled) { background: rgba(255, 255, 255, .22); }
#mp-slides .btn:disabled { opacity: .35; }
#mp-slides .btn.primary { background: var(--accent); }
#mp-slides .ms-stage { position: relative; background: #000; display: grid; place-items: center; min-height: 120px; }
#mp-slides .ms-stage img { display: block; width: 100%; height: auto; max-height: calc(100vh - 200px); object-fit: contain; user-select: none; -webkit-user-drag: none; }
#mp-slides .ms-msg { position: absolute; inset: auto 0 8px 0; text-align: center; font-size: .8rem; opacity: .7; pointer-events: none; }
#mp-slides .ms-foot { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(255, 255, 255, .06); font-size: .8rem; }
#mp-slides .ms-live { flex: 1; font-weight: 650; color: #8fe0b0; }
.ms-section { display: flex; flex-direction: column; gap: 8px; }
.ms-decks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ms-deck { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--r); background: var(--surface2); }
.ms-deck.live { outline: 2px solid var(--accent); }
.ms-deck .ms-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { #mp-slides { width: calc(100vw - 28px); bottom: 70px; } }
#mp-slides .ms-ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#mp-slides .ms-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, #fff 0 14%, #ff2a2a 30%, rgba(255, 0, 0, .35) 62%, rgba(255, 0, 0, 0) 72%); box-shadow: 0 0 14px 4px rgba(255, 40, 40, .55); }
#mp-slides .ms-tools { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: rgba(255, 255, 255, .06); flex-wrap: wrap; }
#mp-slides .ms-color { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); cursor: pointer; padding: 0; }
#mp-slides .ms-color.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }

/* récompenses : badges, points */
.mp-worn { margin-left: 6px; font-size: .9rem; letter-spacing: 1px; }
.mp-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-badge-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; background: var(--bc, #888); box-shadow: 0 0 0 2px rgba(22, 26, 37, .18); cursor: pointer; padding: 0; font-size: 1.4rem; transition: transform .12s; }
.mp-badge-btn:hover { transform: scale(1.1); }
.mp-badge-btn.worn { box-shadow: 0 0 0 3px var(--accent); }
.mp-badge-btn i { position: absolute; right: -6px; bottom: -4px; font-style: normal; font-size: .68rem; font-weight: 800; background: #fff; color: var(--text); border-radius: 999px; padding: 0 5px; box-shadow: 0 0 0 1px rgba(22, 26, 37, .25); }
.mp-badges.big { gap: 10px; }
.mp-badges.big .mp-badge-btn { width: auto; height: auto; border-radius: 14px; padding: 8px 12px; gap: 8px; border-width: 2px; }
.mp-badges.big .mp-badge-btn em { font-style: normal; font-size: .82rem; font-weight: 650; color: #fff; }
.mp-grid.pts { display: flex; gap: 8px; }
.mp-sent { color: var(--ok); font-weight: 650; min-height: 1.4em; }
.mp-rewards { list-style: none; margin: 0; padding: 0; font-size: .82rem; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
#mp-reward { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); z-index: 30; text-align: center; padding: 18px 34px; border-radius: 22px; background: linear-gradient(135deg, #ffe27a, #ffb347); color: #3b2a00; box-shadow: var(--shadow-lg); animation: mp-pop .45s cubic-bezier(.2, 1.4, .4, 1); pointer-events: none; }
#mp-reward.out { opacity: 0; transform: translate(-50%, -14px); transition: .4s; }
#mp-reward small { display: block; font-weight: 700; opacity: .75; letter-spacing: .04em; }
#mp-reward .big { font-size: 2rem; font-weight: 800; line-height: 1.2; }
#mp-reward .why { margin-top: 4px; font-weight: 600; }
@keyframes mp-pop { from { transform: translate(-50%, 20px) scale(.6); opacity: 0; } to { transform: translate(-50%, 0) scale(1); opacity: 1; } }

/* tablette et téléphone : panneau en feuille du bas, supports en haut de l'écran, cibles tactiles plus grandes */
.mp-tbtn { position: absolute; right: 26px; bottom: 108px; width: 56px; height: 56px; border-radius: 50%; justify-content: center; font-size: 1.4rem; background: var(--glass); border-color: var(--glass-line); backdrop-filter: blur(10px); z-index: 13; }
.mp-tbtn.on { background: var(--accent); }
@media (max-width: 820px) {
  #mp-panel { top: auto; right: 0; left: 0; bottom: 0; width: 100%; height: min(70vh, 600px); border-radius: 18px 18px 0 0; }
  #mp-slides { left: 8px; right: 8px; width: auto; top: 58px; bottom: auto; }
  #mp-slides.big { left: 8px; right: 8px; top: 8px; bottom: 8px; transform: none; width: auto; max-height: none; }
  #mp-slides.big .ms-stage { flex: 1; min-height: 0; }
  #mp-slides.big .ms-stage img { max-height: 100%; height: 100%; }
  #mp-panel:not(.hidden) ~ #mp-chatpill, #mp-panel:not(.hidden) ~ #mp-mini { display: none; }
  .mp-dialog { max-height: calc(100vh - 32px); overflow: auto; }
  .mp-badges.big .mp-badge-btn { padding: 6px 9px; }
  .mp-badges.big .mp-badge-btn em { font-size: .74rem; }
}
@media (pointer: coarse) {
  .mp-acts { display: flex; flex-wrap: wrap; }
  .mp-row { flex-wrap: wrap; }
  .mp-ic { width: 38px; height: 38px; font-size: 1.05rem; }
  .mp-tab { padding: 11px 8px; }
  #mp-slides .btn, #mp-slides .btn.sm { min-height: 40px; min-width: 40px; }
  #mp-slides .ms-color { width: 30px; height: 30px; }
  .mp-emoji { font-size: 1.6rem; padding: 6px; }
}

/* Visionneuse du support lié à un écran de diapositives (hors session) */
#deck-viewer { position: fixed; right: 16px; bottom: 16px; z-index: 60; width: min(560px, calc(100vw - 32px)); background: rgba(17, 20, 28, .94); color: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, .45); }
#deck-viewer .dv-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; background: rgba(255, 255, 255, .06); }
#deck-viewer .dv-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
#deck-viewer .dv-count { font-variant-numeric: tabular-nums; font-size: .82rem; opacity: .8; margin-right: 4px; }
#deck-viewer .dv-stage { background: #000; display: grid; place-items: center; cursor: pointer; }
#deck-viewer .dv-stage img { display: block; width: 100%; height: auto; max-height: calc(100vh - 120px); object-fit: contain; user-select: none; -webkit-user-drag: none; }

/* Stylet / doigt sur les supports et les tableaux : pas de sélection de texte ni de menu « enregistrer l'image » à l'appui long */
#mp-slides .ms-stage, #mp-slides .ms-stage * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#mp-slides .ms-stage img { pointer-events: none; }

/* Barre d'actions de la session : toujours visible en bas de l'écran */
#mp-dock { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); display: flex; gap: 4px; padding: 6px; border-radius: 20px; border: 1px solid var(--glass-line); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow); z-index: 13; }
.mp-dk { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 58px; padding: 6px 8px 5px; border: 0; border-radius: 14px; background: transparent; color: var(--text2); font: inherit; cursor: pointer; transition: transform .12s var(--ease), background .12s; }
.mp-dk .ic { font-size: 1.35rem; line-height: 1.1; } .mp-dk .lb { font-size: .68rem; font-weight: 650; letter-spacing: .02em; }
.mp-dk:hover { background: var(--surface3); color: var(--text); transform: translateY(-2px); }
.mp-dk.on { background: var(--accent); color: #fff; }
.mp-dk.dim { opacity: .55; }
.mp-dk.flash { background: var(--accent); color: #fff; animation: mp-pulse 1.4s ease-in-out infinite; }
.mp-dkpop { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; width: max-content; max-width: min(320px, 90vw); padding: 8px; border-radius: 16px; border: 1px solid var(--glass-line); background: var(--glass); backdrop-filter: blur(10px); box-shadow: var(--shadow-lg); }
.mp-dkpop.hidden { display: none; } #mp-dock.hidden { display: none; }
#mp-chatpill { bottom: 216px; }
@media (max-width: 640px) { .mp-dk { min-width: 46px; padding: 5px 4px; } .mp-dk .lb { font-size: .62rem; } .mp-tbtn { display: none; } }
.mp-hist { list-style: none; margin: 6px 0 0; padding: 0; max-height: 220px; overflow: auto; font-size: .82rem; display: flex; flex-direction: column; gap: 3px; }
.mp-hist li { padding: 4px 8px; border-radius: 8px; background: var(--surface3); } .mp-hist time { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; } .mp-hist small { color: var(--muted); }
