/* menu3.css (v10.95) — le menu façon RPG de poche : une liste d'écrans + un écran à la fois, sur une feuille simple.
   Remplace l'habillage « livre de cuir à deux pages » (book.css, menus.css) : même contenu, moins de décor, texte
   plus gros (police lisible pour les petits textes, police pixel réservée aux titres et aux mots appris).
   Chargé en dernier. Structure : ui/panels.js (openPanel → .m3 > nav.m3-nav + .m3-panel > .m3-head, .m3-subs, .m3-body). */

.panel-wrap { --m-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", "Noto Sans KR", "Noto Sans SC", sans-serif;
  --m-bg: #fbf6e8; --m-side: #efe3c6; --m-card: #fffdf6; --m-line: rgba(90, 60, 30, 0.2); --m-edge: #3a3f52; --m-on: #3a3f52; --m-on-ink: #fff8e6;
  --m-ink: #2a1d12; --m-soft: #6d5740; --m-gold: #e0a030; --m-fill: rgba(90, 60, 30, 0.14); }
:root[data-theme="dark"] .panel-wrap { --m-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", "Noto Sans KR", "Noto Sans SC", sans-serif;
  --m-bg: #2b2230; --m-side: #211a26; --m-card: #372c3e; --m-line: rgba(255, 230, 190, 0.16); --m-edge: #7a5038; --m-on: #f0bc58; --m-on-ink: #2a1a10;
  --m-ink: #f6ecd6; --m-soft: #c9b79c; --m-gold: #f0bc58; --m-fill: rgba(255, 240, 210, 0.14); }

.panel-wrap:not(.hidden) { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); place-items: center; padding: 16px; box-sizing: border-box; background: rgba(8, 6, 12, 0.72); backdrop-filter: blur(3px); }

/* ------------------------------------------------------------------ la fenêtre */
.m3 {
  position: relative; box-sizing: border-box; width: min(1080px, 100%); height: min(700px, 100%);
  display: grid; grid-template-columns: 236px minmax(0, 1fr); overflow: hidden;
  background: var(--m-bg); color: var(--m-ink); border: 4px solid var(--m-edge); border-radius: 16px;
  box-shadow: 0 0 0 3px var(--m-bg), 0 0 0 7px var(--m-edge), 0 24px 60px rgba(0, 0, 0, 0.6);
  font-family: var(--m-font); font-size: 16px; line-height: 1.35; word-spacing: normal; letter-spacing: normal;
  animation: m3-in 0.16s ease-out both;
}
@keyframes m3-in { from { opacity: 0; transform: translateY(8px); } }
.m3 *, .m3 *::before, .m3 *::after { box-sizing: border-box; }

/* ------------------------------------------------------------------ la liste des écrans */
.m3 .m3-nav { all: unset; display: flex; flex-direction: column; gap: 4px; padding: 14px 10px; background: var(--m-side); border-inline-end: 2px solid var(--m-line); overflow-y: auto; min-height: 0; }
.m3-nav-head { display: none; }
.m3 .menu-tab {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 8px 12px; border-radius: 10px; cursor: pointer;
  font-family: var(--pixel); font-size: 18px; line-height: 1.1; word-spacing: 0.15em; color: var(--m-ink);
}
.m3 .menu-tab:hover { background: var(--m-fill); transform: none; }
.m3 .menu-tab.on { background: var(--m-on); color: var(--m-on-ink); }
.m3 .menu-tab .mt-icon { flex: none; width: 28px; text-align: center; font-size: 20px; font-family: var(--m-font); }
.m3 .menu-tab .mt-label { display: block !important; flex: 1; min-width: 0; overflow: visible; white-space: normal; overflow-wrap: break-word; text-overflow: clip; }
.m3 .menu-tab kbd { flex: none; font-family: var(--m-font); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: var(--m-fill); color: inherit; box-shadow: none; opacity: 0.8; }
.m3 .menu-tab.on kbd { background: rgba(255, 255, 255, 0.2); }
.m3 .mt-go { display: none; flex: none; font-family: var(--m-font); font-size: 24px; line-height: 1; opacity: 0.55; }
.m3 .pad-focus { outline: 3px solid var(--m-gold); outline-offset: 1px; }

/* ------------------------------------------------------------------ l'écran */
.m3 .m3-panel { all: unset; box-sizing: border-box; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.m3-head { flex: none; display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px 14px 10px 20px; border-bottom: 2px solid var(--m-line); }
.m3-titles { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.m3 .m3-title { margin: 0; font-family: var(--pixel); font-weight: normal; font-size: 28px; line-height: 1.05; color: var(--m-ink); word-spacing: 0.15em; overflow-wrap: anywhere; }
.m3-kicker { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--m-fill); font-size: 14px; font-weight: 700; color: var(--m-ink); white-space: nowrap; }
.m3 .m3-x, .m3 .m3-back, .m3 .m3-turn .turn {
  all: unset; box-sizing: border-box; flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; cursor: pointer;
  background: var(--m-fill); color: var(--m-ink); font-family: var(--m-font); font-size: 18px; font-weight: 700; position: static; transform: none;
}
.m3 .m3-x:hover, .m3 .m3-back:hover, .m3 .m3-turn .turn:hover { background: var(--m-on); color: var(--m-on-ink); }
.m3 .m3-back { display: none; font-size: 28px; line-height: 1; padding-bottom: 4px; }
.m3 .m3-back.always { display: grid; }
.m3-turn { flex: none; display: flex; gap: 6px; }
.m3 .m3-turn .turn { font-size: 14px; }

/* intercalaires (Trophées / Lieux / Pouvoirs…) */
.m3 .m3-subs { flex: none; display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px 0; }
.m3 .sheet-tab { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  background: var(--m-fill); color: var(--m-ink); font-family: var(--m-font); font-size: 15px; font-weight: 600; }
.m3 .sheet-tab.on { background: var(--m-on); color: var(--m-on-ink); box-shadow: none; }

/* le corps : il défile en entier ; les colonnes côte à côte sur grand écran */
.m3-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px 22px; display: grid; gap: 18px 24px; align-content: start; grid-auto-rows: max-content; grid-template-columns: minmax(0, 1fr); }
.m3-body.n2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.m3-body::-webkit-scrollbar { width: 10px; }
.m3-body::-webkit-scrollbar-thumb { background: var(--m-fill); border-radius: 5px; }
.m3 .m3-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: auto; }
.m3 .m3-col :is(.page-scroll, .qscroll, .entries, .phrases) { flex: none; overflow: visible; min-height: 0; padding: 0; }
.m3 .m3-col > :is(.page-scroll, .qscroll) { display: flex; flex-direction: column; gap: 10px; }

/* tout le petit texte en police lisible ; la police pixel revient plus bas pour les titres et les mots */
.m3 .m3-body *:not(canvas) { font-family: var(--m-font); word-spacing: normal; letter-spacing: normal; }
.m3 .m3-body { color: var(--m-ink); }
.m3 .m3-body :is(h3, h4, .qh, .sheet-col-title, .tr-h, .st-h) { margin: 6px 0 0; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--m-soft); }
.m3 .m3-body .chapter-bar { display: block; flex: none; width: 100%; max-width: none; height: 8px; border-radius: 4px; background: var(--m-fill); overflow: hidden; }
.m3 .m3-body .btn { font-size: 16px; min-height: 44px; }
.m3-lead { margin: 0; font-size: 15px; color: var(--m-soft); }

/* ------------------------------------------------------------------ Carnet : le sommaire */
.m3-body.m3-book-sum { grid-template-columns: 290px minmax(0, 1fr); }
.m3-sum { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; background: var(--m-card); box-shadow: inset 0 0 0 2px var(--m-line); }
.m3-sum-top { display: flex; align-items: baseline; gap: 8px; }
.m3 .m3-body .m3-sum-num { font-family: var(--m-font); font-weight: 800; font-size: 56px; line-height: 0.9; color: var(--m-ink); }
.m3-sum-of { font-size: 18px; font-weight: 700; color: var(--m-soft); }
.m3-sum-label { font-size: 16px; font-weight: 700; }
.m3-sum-sub { font-size: 14px; color: var(--m-soft); }
.m3-sum .chapter-bar i { background: linear-gradient(90deg, #c9852f, #e8b85c); }
.m3-sum .btn { margin-top: 6px; width: 100%; justify-content: center; }
.m3 .m3-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.m3 .m3-extras { grid-template-columns: minmax(0, 1fr); }
.m3 .sum-chapter { display: block; margin: 0; }
.m3 .sum-open {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 10px 8px 12px; border-radius: 10px; cursor: pointer;
  background: var(--m-card); box-shadow: inset calc(5px * var(--rtl-x, 1)) 0 0 var(--accent), inset 0 0 0 2px var(--m-line);
}
.m3 .sum-open:hover { background: var(--m-card); box-shadow: inset calc(5px * var(--rtl-x, 1)) 0 0 var(--accent), inset 0 0 0 2px var(--m-gold); }
.m3 .sum-icon { flex: none; width: 30px; text-align: center; font-size: 22px; }
.m3 .sum-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.m3 .m3-body .sum-name b { font-size: 16px; font-weight: 700; color: var(--m-ink); line-height: 1.2; overflow-wrap: anywhere; }
.m3 .sum-name .chapter-bar { height: 6px; }
.m3 .m3-body .sum-count { flex: none; font-size: 14px; font-weight: 700; color: var(--m-soft); }
.m3 .sum-chapter.done .sum-count { color: #2f9a4a; }
.m3 .sum-open .mt-go { display: block; font-size: 20px; }

/* ------------------------------------------------------------------ Carnet : un chapitre (mots, phrases, grammaire) */
.m3-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.m3 .m3-acts .pin-btn { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; min-height: 42px; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  background: linear-gradient(180deg, #fff6d8, #f6dc9a); color: #2a1a10; box-shadow: inset 0 0 0 2px #e0a030, 0 2px 0 #b07a1c; font-size: 15px; font-weight: 700; margin: 0; }
.m3 .m3-acts .stamp { position: static; transform: rotate(-3deg); font-size: 14px; font-weight: 800; padding: 4px 10px; }
.m3 .entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; }
.m3 .entry { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 84px; padding: 8px 10px; border-radius: 12px; background: var(--m-card); box-shadow: inset 0 0 0 2px var(--m-line); color: var(--m-ink); }
.m3 .entry.got:hover { background: var(--m-card); box-shadow: inset 0 0 0 2px var(--m-gold); }
.m3 .entry.missing { background: none; box-shadow: inset 0 0 0 2px var(--m-line); opacity: 0.8; }
.m3 .entry .entry-pic, .m3 .entry.got .entry-pic, .m3 .entry:nth-child(even).got .entry-pic { flex: none; width: 68px; height: 68px; transform: none; border-radius: 8px; background: var(--m-fill); box-shadow: none; }
.m3 .entry-pic canvas.pix { width: 64px; height: 64px; }
.m3 .entry-words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.m3 .m3-body .entry-target { font-family: var(--pixel); font-weight: normal; font-size: 22px; line-height: 1.1; color: var(--m-ink); word-spacing: 0.12em; white-space: normal; overflow-wrap: anywhere; }
.m3 .m3-body .entry-target * { font-family: var(--pixel); }
.m3 .m3-body .entry.missing .entry-target { text-decoration: none; font-family: var(--m-font); font-size: 18px; font-weight: 700; color: var(--m-soft); letter-spacing: 0.1em; }
.m3 .m3-body :is(.entry-native, .entry-hint) { font-style: normal; font-size: 15px; color: var(--m-soft); white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.m3 .m3-body .entry-todo { align-self: flex-start; margin-top: 2px; padding: 1px 8px; border-radius: 999px; background: rgba(224, 160, 48, 0.22); font-style: normal; font-size: 12px; font-weight: 700; color: var(--m-ink); }
.m3 .entry-star { position: static; flex: none; font-size: 22px; color: #e0a020; text-shadow: none; }
.m3 .m3-body .entry-bonus { position: absolute; top: 6px; right: 8px; bottom: auto; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; }
.m3 .entry { position: relative; }
.m3 .phrases { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.m3 .phrase { display: flex; flex-direction: column; gap: 3px; min-height: 60px; padding: 10px 12px 10px 44px; border-radius: 10px; background: var(--m-card); box-shadow: inset 0 0 0 2px var(--m-line); color: var(--m-ink); }
.m3 .phrase.missing { background: none; opacity: 0.75; }
.m3 .phrase.got:hover { background: var(--m-card); box-shadow: inset 0 0 0 2px var(--m-gold); }
.m3 .m3-body .phrase .entry-num { position: absolute; left: 10px; top: 12px; width: 26px; text-align: center; font-size: 14px; font-weight: 700; color: var(--m-soft); }
.m3 .m3-body .phrase-target { font-size: 17px; font-weight: 700; color: var(--m-ink); line-height: 1.3; }
.m3 .m3-body .phrase-native { font-style: normal; font-size: 14px; color: var(--m-soft); }

/* ------------------------------------------------------------------ Objectifs */
.m3 .sum-tracked, .m3 .sum-tracked.big { margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--m-card); box-shadow: inset 0 0 0 3px var(--accent, var(--m-gold)); }
.m3 .m3-body .qt-kicker { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--m-soft); }
.m3 .m3-body .sum-tracked-label { font-size: 18px; font-weight: 700; color: var(--m-ink); }
.m3 .bk-todo ol { gap: 10px; margin-top: 10px; }
.m3 .m3-body .bk-todo li { gap: 10px; font-size: 16px; color: var(--m-soft); }
.m3 .m3-body .bk-todo li.cur { font-size: 18px; font-weight: 700; color: var(--m-ink); }
.m3 .m3-body .bk-todo li.bonus { font-size: 14px; }
.m3 .m3-body .bk-todo li b { font-size: 15px; white-space: nowrap; }
.m3 .bk-box { width: 24px; height: 24px; border-radius: 6px; font-size: 13px; }
.m3 .act { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--m-card); box-shadow: inset 0 0 0 2px var(--m-line); border: none; }
.m3 .act.active { box-shadow: inset 0 0 0 3px var(--m-gold); }
.m3 .act.later { opacity: 0.7; }
.m3 .act-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 0; border: none; background: none; }
.m3 .m3-body .act-name { font-size: 17px; font-weight: 800; color: var(--m-ink); }
.m3 .m3-body :is(.act-count, .act-seal) { font-size: 14px; font-weight: 700; color: var(--m-soft); }
.m3 .qstep { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 0; padding: 8px 0 0; border: none; border-top: 1px solid var(--m-line); background: none; border-radius: 0; box-shadow: none; }
.m3 .m3-body .qcheck { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--m-fill); font-size: 13px; font-weight: 800; color: var(--m-ink); }
.m3 .qstep.done .qcheck { background: #3fae6a; color: #fff; }
.m3 .qstep-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.m3 .m3-body .qstep-label { font-size: 16px; font-weight: 700; color: var(--m-ink); line-height: 1.25; }
.m3 .m3-body :is(.qstep-where, .qstep-tip) { font-size: 14px; color: var(--m-soft); }
.m3 .m3-body .qstep-count { flex: none; font-size: 14px; font-weight: 700; color: var(--m-soft); white-space: nowrap; }
.m3 .qstep.locked { opacity: 0.6; }
.m3 .qstep.locked .qstep-where, .m3 .qstep.locked ~ .qstep.locked .qstep-tip { display: none; }
.m3 .m3-body .qstep-done-sum { font-size: 14px; font-weight: 700; margin: 6px 0 0; }
.m3 .rivals { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.m3 .rival { padding: 8px 10px; border-radius: 10px; background: var(--m-card); }
.m3 .m3-body .rival-body b { font-size: 16px; font-weight: 700; color: var(--m-ink); }
.m3 .m3-body :is(.rival-cat, .rival-status) { font-size: 13px; }

/* ------------------------------------------------------------------ Carte */
.m3-body.m3-map { grid-template-columns: minmax(0, 1fr) 240px; }
.m3-map .pg-map-wrap { width: 100%; max-width: calc((min(700px, 100dvh - 32px) - 140px) * var(--ratio, 1.3)); margin: 0 auto; }
.m3 .m3-body .pg-where { margin: 0; font-size: 16px; font-weight: 700; color: var(--m-ink); }
.m3 .m3-body .pg-hint { margin: 0; font-size: 14px; opacity: 1; color: var(--m-soft); }
.m3 .m3-body .pg-legend { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 8px; margin: 4px 0 0; font-size: 14px; color: var(--m-ink); }
.m3 .pg-legend > span { display: flex; align-items: center; gap: 4px; line-height: 1.2; }

/* ------------------------------------------------------------------ Réglages, Profil, Collection : même contenu, texte lisible */
.m3 .m3-body .set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 46px; padding: 8px 12px; border-radius: 10px; background: var(--m-card); box-shadow: inset 0 0 0 1px var(--m-line); font-size: 15px; color: var(--m-ink); }
.m3 .m3-body .set-row .slider { width: 46%; accent-color: #d0603a; }
.m3 .m3-body .set-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding-top: 8px; }
.m3 .m3-body .seg-btn { min-height: 34px; padding: 5px 10px; font-size: 14px; font-weight: 600; }

/* ------------------------------------------------------------------ écran bas (téléphone couché, petite fenêtre) */
@media (max-height: 520px) {
  .panel-wrap:not(.hidden) { padding: 0; }
  .m3 { width: 100%; height: 100%; border-radius: 0; border-width: 0; box-shadow: none; grid-template-columns: 176px minmax(0, 1fr);
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  .m3 .m3-nav { padding: 8px 6px; gap: 2px; }
  .m3 .menu-tab { min-height: 42px; padding: 4px 10px; font-size: 17px; }
  .m3-head { min-height: 52px; padding: 6px 10px 6px 14px; }
  .m3 .m3-title { font-size: 24px; }
  .m3-body { padding: 12px 14px 16px; }
  .m3 .m3-subs { padding: 8px 14px 0; }
  .m3-map .pg-map-wrap { max-width: calc((100dvh - 150px) * var(--ratio, 1.3)); }
  .m3-body.m3-map { grid-template-columns: minmax(0, 1fr) 200px; }
  .m3-body.m3-book-sum { grid-template-columns: 220px minmax(0, 1fr); }
  .m3 .m3-body .m3-sum-num { font-size: 44px; }
}

/* ------------------------------------------------------------------ écran étroit (téléphone tenu droit) : la liste OU l'écran */
@media (max-width: 699px) {
  .panel-wrap:not(.hidden) { padding: 0; }
  .m3 { width: 100%; height: 100%; border-radius: 0; border-width: 0; box-shadow: none; grid-template-columns: minmax(0, 1fr);
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  .m3 .m3-nav { display: none; }
  .m3.m3-list .m3-nav { display: flex; gap: 10px; padding: 0 14px 18px; border: none; background: var(--m-bg); }
  .m3.m3-list .m3-panel { display: none; }
  .m3-nav-head { display: flex; align-items: center; justify-content: space-between; min-height: 64px; margin: 0 -14px 4px; padding: 10px 14px 10px 20px; border-bottom: 2px solid var(--m-line); }
  .m3-nav-head h2 { margin: 0; font-family: var(--pixel); font-weight: normal; font-size: 28px; color: var(--m-ink); }
  .m3.m3-list .menu-tab, .m3.m3-list .menu-tab.on { min-height: 64px; padding: 10px 16px; font-size: 24px; background: var(--m-card); color: var(--m-ink); box-shadow: inset 0 0 0 2px var(--m-line); border-radius: 14px; }
  .m3.m3-list .menu-tab .mt-icon { width: 36px; font-size: 26px; }
  .m3.m3-list .menu-tab kbd { display: none; }
  .m3.m3-list .mt-go { display: block; }
  .m3 .m3-back { display: grid; }
  .m3-head { padding: 10px 12px; gap: 8px; }
  .m3 .m3-title { font-size: 24px; }
  .m3 .m3-subs { padding: 10px 12px 0; }
  .m3-body, .m3-body.n2, .m3-body.m3-book-sum, .m3-body.m3-map { grid-template-columns: minmax(0, 1fr); padding: 14px 12px 24px; }
  .m3-map .pg-map-wrap { max-width: none; }
  .m3 .m3-list { grid-template-columns: minmax(0, 1fr); }
  .m3 .entries { grid-template-columns: minmax(0, 1fr); }
  .m3 .phrases { grid-template-columns: minmax(0, 1fr); }
  .m3 .m3-body .set-row .slider { width: 40%; }
}

/* ------------------------------------------------------------------ plancher de lisibilité : plus aucun texte sous 13 px */
.m3 .m3-body :is(.tr-name i, .tr-run-pb, .foot-note, .ch-title, .ch-empty, .ch-legend span, .pg-stat b, .set-val, .set-subhead, .gc-row span, .kb-head span, .kb-help,
  .pg-f-lang span, .pg-f-bar span, .pg-msg, .pw-tag, .pf-langs span, .pf-bar span, .pf-ago, .pw-desc, .pw-how, .pw-count b) { font-size: 14px; }
.m3 .m3-body :is(.tr-name b, .pg-stat, .pg-stat span, .pw-name, .pf-name) { font-size: 16px; }
.m3 .m3-body .ch-box svg text { font-size: 11px; }
.m3 .m3-body kbd { font-size: 13px; font-weight: 700; }
.m3 .m3-body .pw-tag, .m3 .m3-body .set-subhead { font-weight: 700; }

.m3 .m3-body .entry.seen .entry-target, .m3 .m3-body .entry.seen .entry-target * { color: var(--m-ink); opacity: 1; -webkit-text-stroke: 0; text-shadow: none; }
.m3 .m3-body :is(.entry-todo, .pl-lead, .pl-name, .pl-state, .pl-zone, .aid-kicker) { font-size: 13px; }
.m3 .m3-body .pl-lead { font-size: 15px; }
.m3 .m3-kicker { flex: 0 1 auto; min-width: 0; white-space: normal; border-radius: 12px; overflow-wrap: anywhere; }
/* Contrôles : colonnes plus larges, en-têtes qui passent à la ligne au lieu de pousser la page */
.m3 .kb-row { grid-template-columns: minmax(0, 1fr) 64px 64px 64px; gap: 6px; padding: 4px 0; font-size: 15px; }
.m3 .kb-row > * { min-width: 0; }
.m3 .m3-body .kb-head span { font-size: 13px; overflow-wrap: anywhere; text-align: center; }
.m3 .kb-slot { height: 36px; }

/* ------------------------------------------------------------------ écran du menu étroit (tablette droite, à côté de la liste) : une seule colonne */
.m3 .m3-panel { container-type: inline-size; container-name: m3p; }
@container m3p (max-width: 640px) {
  .m3-body, .m3-body.n2, .m3-body.m3-book-sum, .m3-body.m3-map { grid-template-columns: minmax(0, 1fr); }
  .m3-map .pg-map-wrap { max-width: none; }
}
@container m3p (max-width: 420px) {
  .m3 .ctl-grid, .m3 .game-card { grid-template-columns: minmax(0, 1fr); }
}
.m3 .m3-body :is(.ctl, .gc-row, .pf-name, .pw-name, .set-row > span:first-child) { min-width: 0; overflow-wrap: anywhere; }
.m3 .m3-body :is(.pf-name, .pw-name) { flex-wrap: wrap; }
.m3 .m3-body .pw-tag { white-space: normal; }
.m3 .m3-body .set-actions .btn { white-space: normal; }
@media (max-width: 360px) {
  .m3.m3-list .menu-tab, .m3.m3-list .menu-tab.on { font-size: 20px; padding: 10px 12px; }
  .m3 .m3-title { font-size: 21px; }
}
.m3 .m3-body :is(.pf-langs, .pf-bar) { flex-wrap: wrap; min-width: 0; } .m3 .m3-body :is(.pf-langs, .pf-bar) > span { min-width: 0; overflow-wrap: anywhere; }

/* v10.96 : la carte du personnage en tête du Profil, et le créateur ouvert dans le menu (ui/panels.js heroCard / renderLook) */
.m3 .m3-body .pf-hero { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--m-fill); min-width: 0; }
.m3 .m3-body .pf-hero-pic { flex: none; width: 52px; height: 52px; padding: 2px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.55); cursor: pointer; }
.m3 .m3-body .pf-hero-face { display: block; width: 48px; height: 48px; image-rendering: pixelated; }
.m3 .m3-body .pf-hero-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.m3 .m3-body .pf-hero-txt small { font-size: 13px; color: var(--m-soft); }
.m3 .m3-body .pf-hero-txt b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m3 .m3-body .pf-hero-btn { flex: none; max-width: 55%; min-height: 40px; white-space: normal; line-height: 1.15; }
.m3-body.look { overflow: hidden; display: block; padding: 12px 16px 14px; }
.m3-body.look > .m3-col { height: 100%; }
.m3-body.look .pf-look { height: 100%; }
.m3-body.look .creator.cr-embed { height: 100%; }
.m3-body.look .cr-embed .cr-opt.word { font-size: 14px; }
.m3-body.look .cr-embed .cr-label { font-size: 13px; }
@media (max-width: 900px), (max-height: 520px) {
  .m3-body.look { overflow-y: auto; }
  .m3-body.look .creator.cr-embed { grid-template-columns: minmax(0, 1fr); }
  .m3-body.look .cr-embed .cr-panel { height: auto; overflow: visible; }
  .m3-body.look > .m3-col, .m3-body.look .pf-look, .m3-body.look .creator.cr-embed { height: auto; }
}
@media (max-height: 520px) and (min-width: 520px) {   /* téléphone en paysage : aperçu à gauche, options à droite, tout défile */
  .m3-body.look .creator.cr-embed { grid-template-columns: 220px minmax(0, 1fr); }
  .m3-body.look .cr-embed .cr-view { width: 96px; height: 144px; }
}
@media (max-width: 360px) {
  .m3 .m3-body .pf-hero { flex-wrap: wrap; }
  .m3 .m3-body .pf-hero-btn { flex: 1 1 100%; max-width: none; }
}
@media (max-width: 400px) {
  .m3-body.look { padding: 10px 10px 12px; }
  .m3-body.look .cr-embed .cr-stage { padding: 10px 6px 12px; min-width: 0; }
  .m3-body.look .cr-embed .cr-view { width: 128px; height: 192px; }
  .m3-body.look .cr-embed .cr-actions { flex-wrap: wrap; }
  .m3-body.look .creator.cr-embed, .m3-body.look .cr-embed > * { min-width: 0; }
}

/* le créateur dans le menu : rien sous 13 px, rien qui dépasse (mesuré : lg-stats/t/perso_fit.py, 11 tailles × 16 langues) */
.m3 .m3-body.look .cr-embed :is(.cr-anim, .cr-acc-chev, .cr-acc-now, .cr-acc-now span, .cr-label) { font-size: 13px; }
.m3 .m3-body.look .cr-embed .cr-anims { flex-wrap: wrap; }
.m3 .m3-body.look .cr-embed .cr-actions { flex-wrap: wrap; gap: 8px; }
.m3 .m3-body.look .cr-embed .cr-actions .btn { min-width: 0; flex: 1 1 120px; white-space: normal; overflow-wrap: anywhere; line-height: 1.15; }
.m3 .m3-body.look .cr-embed .cr-acc-head { flex-wrap: wrap; min-width: 0; row-gap: 4px; }
.m3 .m3-body.look .cr-embed .cr-acc-head b { min-width: 0; overflow-wrap: anywhere; }
.m3 .m3-body.look .cr-embed .cr-acc-now { min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
.m3 .m3-body.look .cr-embed :is(.cr-stage, .cr-panel, .cr-acc, .cr-acc-body, .cr-row, .cr-opts) { min-width: 0; max-width: 100%; }
@media (max-height: 400px) { .m3 .m3-panel:has(.m3-body.look) .m3-kicker { display: none; } }

/* v10.101 : près d'un personnage, une petite pastille sur une ligne au lieu de la grosse bulle (Logan) */
.wlabel.mini {
  display: flex; align-items: center; gap: 0.45em; padding: 1px 8px 2px; border-width: 2px; border-radius: 999px;
  font-size: 13px; line-height: 1.5; box-shadow: 0 2px 0 var(--pk-edge);
}
.wlabel.mini.hidden { display: none; }
.wlabel.mini::after { display: none; }
.wlabel.mini .wl-main { font-size: 1em; }
html:is([data-learn="ja"], [data-learn="zh"], [data-learn="ko"], [data-learn="yu"]) .wlabel.mini .wl-main { font-size: 1em; }
.wlabel.mini .wl-sub { font-size: 1em; }
.wlabel.mini .wl-sub::before { content: "· "; }
.wlabel.mini .wl-key { order: -1; margin: 0; font-size: 13px; }
body.touch .wlabel.mini.plain { display: none; }
body.touch .wlabel.mini .wl-key { font-size: 0; }

/* v10.102 : pastille rouge « 1 » sur le bouton du menu tant que « Inviter un ami » n'a jamais été ouvert (Logan) */
.hud-esc { position: relative; }
.hud-esc.iv-new::after { content: "1"; position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; box-sizing: border-box; padding: 0 5px;
  border-radius: 10px; background: #e5484d; color: #fff; font: 700 13px/20px var(--m-font); text-align: center; box-shadow: 0 0 0 2px #fff8e6; }
.menu-tab.iv-dot .mt-label::after { content: "1"; display: inline-block; margin-inline-start: 8px; vertical-align: middle; min-width: 20px; height: 20px; box-sizing: border-box; padding: 0 5px;
  border-radius: 10px; background: #e5484d; color: #fff; font: 700 13px/20px var(--m-font); text-align: center; box-shadow: 0 0 0 2px #fff8e6; }
