
    html, body { margin: 0; padding: 0; overflow: hidden; height: 100%; background: #1a1a2e; }
    #app { width: 100vw; height: 100vh; display: block; }
    :root { --teal: #1b5873; --teal2: #2f86ad; --orange: #2fb9a8; --orange-dark: #0f5a50; }
    #topbar {
      position: fixed; top: 6px; left: 50%; transform: translateX(-50%); z-index: 3;
      display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 12px);
      font-family: 'Pixelify Sans', 'Segoe UI', sans-serif; pointer-events: none; white-space: nowrap;
    }
    .grp { display: flex; align-items: center; gap: 16px; }
    .chip.res { pointer-events: auto; cursor: pointer; }
    .chip {
      position: relative; height: 30px; min-width: 0; padding: 0 12px 0 28px; display: flex; align-items: center; gap: 6px;
      background: #f7cfdc; border: 2px solid #4a1f3d; border-radius: 15px; color: #4a1f3d;
      box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.6); font-size: 13px; margin-left: 8px;
    }
    .chip .ico { position: absolute; left: -12px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; margin: 0; }
    .chip b { font-size: 15px; font-variant-numeric: tabular-nums; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
    .chip em { font-style: normal; font-size: 11px; color: #2f7a3d; font-variant-numeric: tabular-nums; }
    .chip .lbl { font-size: 10px; opacity: 0.7; text-transform: uppercase; letter-spacing: .05em; }
    .chip .max { opacity: 0.6; font-size: 11px; }
    .ico { display: inline-block; width: 18px; height: 18px; vertical-align: middle; margin-right: 3px; background: center / contain no-repeat; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5)); }
    .ico.b { background-image: var(--ico-b); } .ico.s { background-image: var(--ico-s); } .ico.w { background-image: var(--ico-w); } .ico.c { background-image: var(--ico-c); } .ico.st { background-image: var(--ico-staff); } .ico.e { background-image: var(--ico-e); } .ico.m { background-image: var(--ico-coffre); } .ico.eve { background-image: var(--ico-ev); } .ico.dc { background-image: var(--ico-dc); } .ico.cu { background-image: var(--ico-cu); } .ico.eq { background-image: var(--ico-eq); } .ico.mt { background-image: var(--ico-mt); } .ico.eqp { background-image: var(--ico-eqp); } .ico.cmp { background-image: var(--ico-cmp); } .ico.inn { background-image: var(--ico-inn); } #more-res { cursor: pointer; }
    .ico.co { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cg fill='%23f2c230'%3E%3Crect x='5' y='0' width='2' height='2'/%3E%3Crect x='4' y='2' width='4' height='1'/%3E%3Crect x='0' y='3' width='12' height='2'/%3E%3Crect x='1' y='5' width='10' height='1'/%3E%3Crect x='2' y='6' width='8' height='1'/%3E%3Crect x='3' y='7' width='6' height='1'/%3E%3Crect x='2' y='8' width='3' height='2'/%3E%3Crect x='7' y='8' width='3' height='2'/%3E%3Crect x='1' y='10' width='3' height='1'/%3E%3Crect x='8' y='10' width='3' height='1'/%3E%3C/g%3E%3Cg fill='%23b8860b'%3E%3Crect x='5' y='5' width='2' height='1'/%3E%3C/g%3E%3C/svg%3E"); }
    .ico.tp { background-image: var(--ico-tp); }
    #team, #clock, #cote, #tampons { pointer-events: auto; cursor: pointer; }
    #tampons.big {
      position: relative; flex: none; width: 70px; height: 70px; border-radius: 50%; margin-top: 22px;
      background: #f7cfdc; border: 3px solid #4a1f3d;
      box-shadow: 0 3px 8px rgba(0,0,0,0.45), inset 0 2px 4px rgba(255,255,255,0.6);
    }
    #tampons.big .pic { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -58%); filter: drop-shadow(0 1px 1px rgba(0,0,0,0.35)); }
    #tampons.big b { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); padding: 1px 9px; border-radius: 9px; white-space: nowrap;
      font-size: 13px; line-height: 1.3; color: #fff2f6; background: #4a1f3d; border: 2px solid #4a1f3d; font-variant-numeric: tabular-nums; }
    #clock { min-width: 0 !important; padding-left: 12px !important; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
    .intro { position: fixed; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center; font-family: 'Pixelify Sans', 'Segoe UI', sans-serif; color: #4a1f3d; }
    .intro.dim { background: rgba(5,15,22,0.55); }
    .intro.away { display: none; }
    .intro .stage { width: 100%; max-width: 860px; display: flex; align-items: center; gap: 10px; padding: 0 10px; box-sizing: border-box; }
    .intro.hidestage .stage { display: none; }
    .intro .who { flex: none; width: 130px; }
    .intro .por { display: block; width: 130px; height: 160px; filter: drop-shadow(0 3px 5px rgba(0,0,0,0.5)); }
    .intro .tag { display: block; position: relative; margin-top: -8px; text-align: center; font-size: 12px; padding: 1px 6px; color: #fff2f6; background: #4a1f3d; border: 2px solid #4a1f3d; border-radius: 9px; }
    .intro .bub { position: relative; flex: 1; max-width: 640px; margin-bottom: 0; padding: 12px 16px 10px; box-sizing: border-box;
      background: #f7cfdc; border: 3px solid #4a1f3d; border-radius: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.45); }
    .intro .bub:before { content: ''; position: absolute; left: -14px; top: 50%; margin-top: -8px; border: 8px solid transparent; border-right: 11px solid #4a1f3d; }
    .intro .say { margin: 0 0 8px; font-size: 16px; line-height: 1.45; }
    .intro input { width: 100%; box-sizing: border-box; padding: 7px 10px; font: 16px 'Pixelify Sans', sans-serif; color: #4a1f3d; background: #fff8fa; border: 2px solid #4a1f3d; border-radius: 8px; }
    .intro .roles { display: flex; gap: 8px; margin-top: 8px; }
    .intro .roles button { flex: 1; padding: 6px; font: 800 14px 'Pixelify Sans', sans-serif; color: #4a1f3d; background: #fff2f6; border: 2px solid #4a1f3d; border-radius: 8px; cursor: pointer; }
    .intro .roles button.on, .intro .st.on { color: #fff; background: #2fb9a8; border-color: #0f5a50; }
    .intro .irow { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 6px; }
    .intro .err { flex: 1; font-size: 13px; color: #a32d2d; }
    .intro .igo { padding: 8px 26px 6px; font: 700 16px 'Pixelify Sans', sans-serif; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); cursor: pointer;
      background: #2fb9a8; border: 0; border-bottom: 5px solid #0f5a50; border-radius: 10px; }
    .intro .rows { overflow-y: auto; max-height: calc(94vh - 120px); }
    .intro .editor { margin: auto; width: min(720px, 94vw); max-height: 94vh; display: flex; gap: 12px; padding: 12px; box-sizing: border-box;
      background: #f7cfdc; border: 3px solid #4a1f3d; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.55); }
    .intro .prev { flex: none; width: 190px; height: 280px; border-radius: 10px; background: #8fbfd8; }
    .intro .ctl { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
    .intro .ctl h3 { margin: 0 0 2px; font-size: 18px; }
    .intro .rows { display: flex; flex-direction: column; gap: 7px; }
    .intro .rw { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
    .intro .rw label { width: 68px; font-size: 13px; font-weight: 800; }
    .intro .sw { width: 26px; height: 26px; padding: 0; cursor: pointer; border: 2px solid #fff2f6; border-radius: 6px; box-shadow: 0 0 0 1px #7a3a62; }
    .intro .sw.on { box-shadow: 0 0 0 3px #2fb9a8; }
    .intro .st { padding: 4px 9px; font: 800 13px 'Pixelify Sans', sans-serif; color: #4a1f3d; cursor: pointer; background: #fff2f6; border: 2px solid #4a1f3d; border-radius: 8px; }
    #hud:empty, body:has(#pilot.on) #hud, body:has(#panel:not(.hidden)) #hud, body:has(#modal:not(.hidden)) #hud { display: none; } /* les fenetres montrent deja le resultat : la bulle ne les recouvre plus */
    @media (max-width: 1000px), (max-height: 520px) { /* telephone en paysage : barre du haut plus compacte */
      #topbar { top: 1px; gap: 3px; } .grp { gap: 2px; }
      .chip { height: 21px; min-width: 0; padding: 0 6px 0 19px; margin-left: 5px; font-size: 11px; border-width: 2px; } .chip b { font-size: 11.5px; } .chip em { font-size: 9px; } .chip .max { font-size: 9px; }
      .chip .ico { width: 22px; height: 22px; left: -8px; } .chip .lbl { display: none; }
      #tampons.big { width: 44px; height: 44px; margin-top: 6px; border-width: 2px; } #tampons.big .pic { width: 28px; height: 28px; } #tampons.big b { font-size: 9.5px; padding: 0 5px; bottom: -6px; border-width: 1px; }
      #clock { font-size: 11px !important; padding-left: 8px !important; }
      /* boutons et volets un peu plus petits sur telephone : plus de carte visible et des blocs moins lourds (zoom : tailles ET positions suivent) */
      .round, #shoprail, #evrail, #settings-toggle { zoom: .82; }
      .aopt .amt { font-size: 11px; margin: 0 1px; } .aopt .amt .ico { width: 15px; height: 15px; margin-right: 0; } .qslot { min-height: 54px; } .qslot img, .aopt img { width: 62px; height: 37px; } .aopt { padding: 4px 3px; gap: 1px; } .acts { gap: 5px; } .qslots, .aopts { gap: 6px; }
    }
    #hud {
      position: fixed; top: 70px; left: 50%; transform: translateX(-50%); color: #4a1f3d; font-family: 'Pixelify Sans', 'Segoe UI', sans-serif;
      font-size: 13px; background: #f7cfdc; border: 2px solid #4a1f3d; box-shadow: 0 2px 6px rgba(0,0,0,0.4); padding: 7px 12px; border-radius: 10px;
      cursor: pointer; opacity: .94; max-width: min(56vw, 460px); z-index: 50; /* au-dessus des fenetres (fiche, etc.) ; un tap la ferme */
    }
    #panel { position: fixed; inset: 0; z-index: 5; background: rgba(38,22,8,0.78); backdrop-filter: blur(5px);
      font-family: 'Pixelify Sans', 'Segoe UI', sans-serif; color: #4a1f3d; user-select: none; }
    #panel.hidden { display: none; }
    #panel button { font-family: inherit; cursor: pointer; }
    #panel-close { position: absolute; top: 10px; right: 12px; width: 46px; height: 46px; font-size: 26px; font-weight: 700; color: #4a1f3d;
      background: #f7cfdc; border: 3px solid #4a1f3d; border-radius: 8px; }
    .arrow { position: absolute; top: 16px; width: 62px; height: 40px; font-size: 22px; font-weight: 700; color: #fff;
      background: linear-gradient(#3fcfbd, var(--orange)); border: 0; border-bottom: 4px solid var(--orange-dark); border-radius: 14px; }
    #panel-prev { left: 160px; } #panel-next { right: 80px; }
    #panel-tabs { position: absolute; left: 0; top: 70px; display: flex; flex-direction: column; gap: 6px; }
    .tab { width: 118px; height: 64px; padding: 4px; font-size: 12px; font-weight: 800; letter-spacing: .04em; color: #4a1f3d;
      background: #f7cfdc; border: 2px solid #4a1f3d; border-left: 0; border-radius: 0 8px 8px 0; }
    .tabmv { width: 118px; height: 40px; padding: 4px; font-family: inherit; font-size: 12px; font-weight: 800; letter-spacing: .04em; color: #fff; background: #e8892b; border: 2px solid #4a1f3d; border-left: 0; border-radius: 0 8px 8px 0; cursor: pointer; } .tabmv:disabled { opacity: .45; cursor: not-allowed; }
    .tab.active { background: #2fb9a8; color: #fff; width: 128px; }
    #panel-head { position: absolute; left: 160px; top: 72px; right: 48%; padding: 10px 14px 12px; background: linear-gradient(#ffe4ec, #f7cfdc); border: 3px solid #4a1f3d; border-radius: 12px; box-shadow: 0 4px 0 #4a1f3d, 0 8px 14px rgba(0,0,0,.35); }
    #panel-kind { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff2f6; background: #4a1f3d; padding: 1px 8px; border-radius: 6px; }
    #panel-name { margin: 4px 0 6px; font-size: 22px; font-weight: 700; letter-spacing: .02em; line-height: 1.1; }
    #panel-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; max-width: 100%; } #panel-meta > * { white-space: nowrap; max-width: 100%; }
    #panel-lvl { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; }
    #panel-lvl .lv { padding: 2px 8px; border: 2px solid #4a1f3d; border-radius: 8px; background: #fff2f6; font-weight: 700; } #panel-lvl .lv.next { background: #2fb9a8; color: #fff; border-color: #0f5a50; box-shadow: 0 0 0 2px #ffe4ec, 0 0 0 4px #2fb9a8; }
    #panel-lvl .arr { width: 0; height: 0; border: 6px solid transparent; border-left: 9px solid #4a1f3d; border-right: 0; }
    #panel-lvl { font-size: 17px; opacity: 0.55; font-weight: 400; }
    #panel-era { display: inline-block; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: 800; background: var(--orange); color: #fff; padding: 3px 8px; border-radius: 6px; }
    #panel-3d { position: absolute; right: 8%; top: 70px; width: 40%; height: 40%; min-height: 150px; }
    #panel-body { position: absolute; left: 160px; right: 6%; bottom: 14px; min-height: 110px; padding: 14px 18px; background: #f7cfdc; border: 3px solid #4a1f3d; border-radius: 10px; }
    .lvlb { width: 26px; height: 24px; margin-left: 4px; font-size: 12px; color: #4a1f3d; cursor: pointer; border-radius: 6px; border: 2px solid #4a1f3d; background: #fff2f6; vertical-align: middle; }
    #panel-new { display: none; margin-top: 8px; padding: 6px 8px 7px; font-size: 13px; line-height: 1.25; max-width: 320px; background: #fff3c4; border: 2px dashed #d9a400; border-radius: 10px; color: #5a3b00; animation: newglow 1.6s ease-in-out infinite; }
    #panel-new.on { display: block; } #panel-new .newtag { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 3px; padding: 1px 8px 1px 6px; font-size: 11px; font-weight: 800; letter-spacing: .1em; color: #4a1f3d; background: #f2c230; border: 2px solid #4a1f3d; border-radius: 999px; }
    #panel-new .newtag i { width: 8px; height: 8px; background: #fff; border: 2px solid #4a1f3d; transform: rotate(45deg); } #panel-new .newtxt { display: block; font-weight: 600; }
    @keyframes newglow { 50% { box-shadow: 0 0 0 3px rgba(242,194,48,.55); } } @media (prefers-reduced-motion: reduce) { #panel-new { animation: none; } }
    #evrail { position: fixed; left: 10px; top: 214px; z-index: 3; display: flex; flex-direction: column; gap: 8px; font-family: 'Pixelify Sans', 'Segoe UI', sans-serif; }
    .ev { position: relative; width: 44px; height: 44px; padding: 0; cursor: pointer; text-align: center; color: #4a1f3d;
      background: #f7cfdc; border: 3px solid #4a1f3d; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,0.4); }
    .ev i { display: block; width: 26px; height: 26px; margin: 2px auto 0; line-height: 26px; font: 700 18px 'Pixelify Sans', sans-serif; font-style: normal; color: #fff; background: #c0392b; border-radius: 6px; }
    .ev.gift i { background: #f0b323; }
    .ev small { position: absolute; left: 0; right: 0; bottom: 1px; font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
    .evopt { display: block; width: 100%; margin: 6px 0; padding: 8px 10px; font: 800 14px 'Pixelify Sans', sans-serif; color: #fff; cursor: pointer; text-shadow: 0 1px 2px rgba(0,0,0,0.5);
      background: #2fb9a8; border: 0; border-bottom: 4px solid #0f5a50; border-radius: 8px; }
    #people { position: fixed; inset: 0; z-index: 7; display: none; font-family: 'Pixelify Sans', 'Segoe UI', sans-serif; color: #4a1f3d; background: rgba(38,22,8,0.72); }
    #people.open { display: block; }
    #people .pbox { position: absolute; left: 10px; right: 10px; top: 10px; bottom: 10px; max-width: 900px; margin: auto; display: flex; flex-direction: column; background: #f7cfdc; border: 3px solid #4a1f3d; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.55); }
    #people .pbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 3px solid #4a1f3d; }
    #people .ptab { padding: 6px 14px; font: 800 14px 'Pixelify Sans', sans-serif; color: #4a1f3d; cursor: pointer; background: #fff2f6; border: 2px solid #4a1f3d; border-radius: 8px; }
    #people .ptab.on { color: #fff; background: #2fb9a8; border-color: #0f5a50; }
    #people .psum { flex: 1; text-align: right; font-size: 13px; opacity: .8; }
    #people .px { width: 34px; height: 34px; font: 700 20px sans-serif; color: #4a1f3d; cursor: pointer; background: #fff2f6; border: 2px solid #4a1f3d; border-radius: 8px; }
    #people .plist { flex: 1; overflow-y: auto; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; align-content: start; }
    #people .pcard { display: grid; grid-template-columns: 56px 1fr; gap: 4px 10px; padding: 8px; background: #fffafb; border: 2px solid #4a1f3d; border-radius: 10px; }
    #people .pcard img { grid-row: 1 / 4; width: 56px; height: 56px; image-rendering: pixelated; background: #cfe3ee; border: 2px solid #4a1f3d; border-radius: 8px; }
    #people .pcard b { font-size: 15px; } #people .pcard small { font-size: 12px; opacity: .85; line-height: 1.3; }
    #people .pcard .pst { font-size: 12px; font-weight: 700; color: #2f7a3d; }
    #people .phead { grid-column: 1 / -1; font-weight: 800; font-size: 14px; padding-top: 6px; border-top: 2px solid #4a1f3d; }
    #people .phire { grid-column: 1 / -1; padding: 6px; font: 800 14px 'Pixelify Sans', sans-serif; color: #fff; cursor: pointer; background: #2fb9a8; border: 0; border-bottom: 3px solid #0f5a50; border-radius: 8px; }
    /* equipe : 3 sortes de cartes bien differentes */
    #people .pcard { position: relative; } #people .pbadge { position: absolute; top: 6px; right: 8px; padding: 1px 8px; font-size: 10px; font-weight: 800; letter-spacing: .08em; border-radius: 999px; }
    #people .pcard.post { border-color: #2f7a3d; background: #f4fff6; box-shadow: 0 3px 0 #2f7a3d; } #people .pcard.post .pbadge { color: #fff; background: #2f7a3d; }
    #people .pcard.vacant { border: 3px dashed #e8892b; background: #fff6ea; } #people .pcard.vacant .pbadge { color: #fff; background: #e8892b; } #people .pcard.vacant img, #people .pcard.slot img { filter: brightness(.4) grayscale(1); opacity: .7; } #people .pcard.vacant .pst { color: #b4631a; }
    #people .pcard.slot { border: 3px dotted #9a8aa8; background: #f3eef6; } #people .pcard.slot .pbadge { color: #fff; background: #8a6aa8; } #people .pcard.slot .pst { color: #6e4f88; }
    #people .pcard.click { cursor: pointer; } #people .pcard.click:hover { background: #e3fbe9; }
    #people .pnote { grid-column: 1 / -1; padding: 8px 10px; font-size: 12px; background: #fff2f6; border: 2px dashed #b8869b; border-radius: 10px; line-height: 1.4; } #people .pnote .phire { margin-top: 6px; display: block; }
    /* candidatures : en poste (vert), pret (dore), a collecter (gris) */
    .cgroup { margin: 10px 0 4px; font-weight: 800; font-size: 13px; letter-spacing: .04em; } .cgroup.post { color: #2f7a3d; } .cgroup.ready { color: #a87400; } .cgroup.todo { color: #7a6a88; }
    .ccard { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; margin: 6px 0; padding: 7px 8px; border: 2px solid #4a1f3d; border-radius: 12px; background: #fffafb; text-align: left; }
    .ccard img { width: 52px; height: 52px; image-rendering: pixelated; border: 2px solid #4a1f3d; border-radius: 8px; background: #cfe3ee; }
    .ccard.post { border-color: #2f7a3d; background: #f4fff6; } .ccard.ready { border: 3px solid #d9a400; background: #fff7d6; box-shadow: 0 0 0 2px #fff0a0; } .ccard.todo { border-style: dashed; background: #f1ecf4; } .ccard.todo img { filter: grayscale(1) brightness(.55); }
    .ccard .cinfo small { display: block; font-size: 11px; opacity: .8; line-height: 1.3; } .cright { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
    .ccard .prof { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; } .prof .cat { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 9px; background: #e3d8f5; color: #4a1f3d; } .prof .cat.confirme { background: #c9ece7; } .prof .cat.legendaire { background: #ffe39a; }
    .prof .tr { font-size: 10px; padding: 1px 5px; border-radius: 8px; background: #f0eaf6; color: #4a1f3d; white-space: nowrap; } .prof .tr.presence { background: #dff3f0; } .prof .tr b { font-weight: 400; color: #8f78e0; letter-spacing: -1px; }
    /* carte d'enseignant (carteprof.js) : une carte a la fois dans un carrousel a fleches ; le personnage prend pres de la moitie de la carte, sur un fond a rayons qui change avec la categorie */
    .tcarw { margin: 6px 0; } .tcar { display: flex; align-items: center; justify-content: center; gap: 6px; } .tview { flex: 1; min-width: 0; max-width: 680px; }
    .tview .tcard { display: none; } .tview .tcard.on { display: flex; }
    .tnav { flex: none; width: 44px; height: 44px; padding: 0 0 4px; border: 3px solid #4a1f3d; border-radius: 50%; background: #fff; box-shadow: 0 3px 0 #4a1f3d; color: #4a1f3d; font: 800 26px/1 'Pixelify Sans', sans-serif; cursor: pointer; touch-action: manipulation; } .tnav:active { transform: translateY(2px); box-shadow: 0 1px 0 #4a1f3d; } .tnav[disabled] { opacity: .35; cursor: default; }
    .tcount { margin-top: 4px; text-align: center; font-size: 12px; letter-spacing: .06em; opacity: .8; }
    .tcard { --fr: #4a1f3d; --bg: #fff6ee; --ink: #4a1f3d; --ray1: #f3d9ec; --ray2: #fbe9f5; --plate: #4a1f3d; --plateink: #fff; position: relative; display: flex; flex-direction: row; border: 3px solid var(--fr); border-radius: 14px; background: var(--bg); color: var(--ink); text-align: left; box-shadow: 0 3px 0 rgba(74, 31, 61, .25); overflow: hidden; }
    .tcard.confirme { --fr: #178a7e; --bg: #e8faf6; --ink: #12423d; --ray1: #a9e6dc; --ray2: #d6f6f0; --plate: #178a7e; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2fb9a8, 0 3px 0 4px rgba(23, 138, 126, .3); }
    .tcard.legendaire { --fr: #a87800; --bg: linear-gradient(160deg, #fff4c4 0%, #ffe28a 45%, #f6c445 100%); --ink: #4a2d00; --ray1: #ffd45e; --ray2: #fff0b0; --plate: #7a5200; box-shadow: 0 0 0 2px #fff6cf, 0 0 0 5px #d9a400, 0 0 14px 3px rgba(255, 207, 66, .65); }
    .tcard .tart { flex: 0 0 46%; position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 6px 0; background: repeating-conic-gradient(from 0deg at 50% 62%, var(--ray1) 0 10deg, var(--ray2) 10deg 20deg); overflow: hidden; }
    .tcard .tcat { position: absolute; top: 0; left: 0; display: flex; padding: 3px 10px; white-space: nowrap; background: var(--plate); color: var(--plateink); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; z-index: 2; border-bottom-right-radius: 8px; }
    .tcard .tphoto { position: relative; width: min(100%, 178px); aspect-ratio: 1; margin: 0 0 -20px; filter: drop-shadow(0 4px 0 rgba(74, 31, 61, .25)); }
    .tcard .tphoto img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
    .tcard .shine { position: absolute; inset: 0; overflow: hidden; border-radius: 50%; pointer-events: none; } .tcard .shine::after { content: ''; position: absolute; top: -20%; bottom: -20%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .8), transparent); transform: translateX(-160%) skewX(-18deg); animation: tshine 3.6s ease-in-out infinite; }
    @keyframes tshine { 0%, 55% { transform: translateX(-160%) skewX(-18deg); } 100% { transform: translateX(380%) skewX(-18deg); } }
    @media (prefers-reduced-motion: reduce) { .tcard .shine { display: none; } }
    .tcard .tplate { align-self: stretch; margin: auto -6px 0; padding: 4px 6px 5px; text-align: center; line-height: 1.15; background: var(--plate); color: var(--plateink); position: relative; z-index: 1; } .tcard .tplate small { display: block; font-size: 11px; opacity: .85; } .tcard .tplate b { display: block; font-size: 16px; } .tcard .tplate i { display: block; margin-top: 1px; font-size: 11px; font-style: normal; font-weight: 700; color: #ffe9b0; } .tcard .tplate i.soon { color: #ffd0a0; }
    /* cote droit : tout se repartit sur la hauteur, aucun espace vide */
    .tcard .tdet { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; padding: 8px 8px 6px; font-family: 'Pixelify Sans', 'Segoe UI', sans-serif; }
    .tcard .bubble { margin: 0; padding: 5px 9px; border: 2px solid var(--fr); border-radius: 12px; background: #fff; font-size: 12px; line-height: 1.3; text-align: left; }
    .tcard .tsec { display: flex; flex-direction: column; gap: 2px; } .tcard .tgl { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
    .tcard .ticons { display: flex; gap: 3px; } .tcard .ti { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
    .tcard .tico { width: 32px; height: 32px; display: block; } .tcard .ti small { max-width: 100%; font-size: 10px; line-height: 1.15; white-space: nowrap; overflow: hidden; }
    .tcard .pips { font-size: 9px; letter-spacing: 1px; color: #8f78e0; white-space: nowrap; } .tcard .pips i { font-style: normal; color: currentColor; opacity: .2; }
    .tcard .tmanie { flex: 1 1 auto; } .tcard .tmanie .tquirk { flex: 1; display: flex; align-items: center; margin: 0; padding: 4px 8px; border-radius: 10px; background: rgba(255, 255, 255, .6); font-size: 12px; line-height: 1.3; }
    .tcard .tact { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-top: 2px; } .tcard .tact .cbadge { margin: 0; }
    .tcard.retired { filter: grayscale(.8); opacity: .75; }
    .tprio { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 6px; padding: 3px 8px; border: 3px solid #178a7e; border-radius: 12px; background: #e8faf6; font-size: 13px; } .tprio small { display: block; opacity: .8; font-size: 11px; } .tchips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
    .tchip { padding: 3px 9px; font: 700 12px 'Pixelify Sans', sans-serif; color: #12423d; cursor: pointer; border: 2px solid #178a7e; border-radius: 999px; background: #fff; } .tchip.on { color: #fff; background: #178a7e; }
    .tdraw { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 6px; padding: 3px 10px; border: 3px solid #a87800; border-radius: 12px; background: linear-gradient(160deg, #fff4c4, #ffe28a); font-size: 13px; } .tdraw small { display: block; opacity: .8; font-size: 11px; } .tdraw .tdgo { padding: 6px 12px; font: 800 12px 'Pixelify Sans', sans-serif; color: #fff; cursor: pointer; border: 0; border-bottom: 3px solid #5a3d00; border-radius: 8px; background: #a87800; } .tdraw .tdgo[disabled] { opacity: .45; cursor: default; }
    /* ecran etroit en portrait : la carte se met debout */
    @media (max-width: 560px) and (orientation: portrait) { .tcard { flex-direction: column; } .tcard .tart { flex: none; } .tcard .tphoto { width: 132px; } .tnav { width: 36px; height: 36px; font-size: 22px; } }
    /* gsm en paysage : la carte doit tenir dans la hauteur */
    @media (max-height: 520px) { .tcard .tart { padding-top: 18px; } .tcard .tphoto { width: min(100%, 150px); } .tcard .tdet { gap: 2px; padding: 5px 8px 4px; } .tcard .bubble { padding: 3px 8px; font-size: 11px; line-height: 1.2; } .tcard .tico { width: 26px; height: 26px; } .tcard .ti small { font-size: 9px; } .tcard .tgl { font-size: 9.5px; } .tcard .tmanie .tquirk { padding: 2px 6px; font-size: 11px; line-height: 1.2; } .tcard .tplate b { font-size: 15px; } .tcount { margin-top: 2px; } }
    .cbadge { padding: 1px 8px; font-size: 10px; font-weight: 800; letter-spacing: .08em; color: #fff; border-radius: 999px; } .cbadge.post { background: #2f7a3d; } .cbadge.todo { background: #8a6aa8; }
    .cbar { position: relative; height: 14px; margin-top: 4px; background: #e2d8ea; border: 2px solid #5a4a68; border-radius: 8px; overflow: hidden; } .cbar i { display: block; height: 100%; background: #8a6aa8; } .cbar span { position: absolute; inset: 0; text-align: center; font-size: 10px; font-weight: 800; line-height: 11px; color: #2a1f33; }
    .chire, .cbuy { padding: 5px 10px; font: 800 12px 'Pixelify Sans', sans-serif; color: #fff; cursor: pointer; border: 0; border-bottom: 3px solid #0f5a50; border-radius: 8px; background: #2fb9a8; } .cbuy { background: #b0306a; border-bottom-color: #6e1c40; }
    .cmsg { margin: 4px 0 6px; padding: 5px 8px; font-weight: 800; font-size: 13px; color: #2f7a3d; background: #e3fbe9; border: 2px solid #2f7a3d; border-radius: 8px; }
    #people .pcard.off { opacity: .6; } #people .pcard.off .pst { color: #7a3a62; }
    #shoprail { position: fixed; right: 10px; top: 118px; z-index: 3; display: flex; flex-direction: column; gap: 8px; font-family: 'Pixelify Sans', 'Segoe UI', sans-serif; }
    .shop { position: relative; width: 48px; height: 54px; padding: 0; cursor: pointer; color: #4a1f3d; text-align: center; background: #f7cfdc; border: 3px solid #4a1f3d; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,0.4); }
    .shop i { display: block; width: 34px; height: 34px; margin: 6px auto 0; background: center / contain no-repeat; }
    .shop img { display: block; width: 40px; height: 40px; margin: 3px auto 0; object-fit: contain; image-rendering: pixelated; border-radius: 6px; background: #ffe4ec; }
    .shop i.badge { position: absolute; right: -8px; bottom: -8px; width: 26px; height: 26px; margin: 0; background-color: #fff2f6; border: 2px solid #4a1f3d; border-radius: 50%; background-size: 82%; background-position: center; font: 800 20px/20px 'Pixelify Sans', sans-serif; color: #4a1f3d; text-align: center; }
    .shop.up { border-color: #2f7a3d; }
    .rotb { position: absolute; width: 44px; height: 44px; font-size: 18px; color: #4a1f3d; cursor: pointer; border-radius: 50%; border: 3px solid #4a1f3d;
      background: #f7cfdc; box-shadow: 0 3px 8px rgba(0,0,0,0.5); }
    #panel-rot-l { right: calc(28% + 6px); top: calc(70px + 40% + 4px); } #panel-rot-r { right: calc(28% - 50px); top: calc(70px + 40% + 4px); }
    .prod { display: flex; flex-direction: column; align-items: center; gap: 12px; }
    .barrow { display: flex; align-items: center; gap: 14px; width: 100%; }
    .auto { font-size: 13px; font-weight: 800; color: #0f5a50; min-width: 70px; }
    .bar { position: relative; flex: 1; height: 22px; background: #e8b4c6; border-radius: 11px; overflow: hidden; border: 2px solid #4a1f3d; }
    .bar .fill { height: 100%; background: #2f9d5c; border-radius: 11px; transition: width .5s; }
    .bar .t { position: absolute; inset: 0; text-align: center; font-size: 13px; font-weight: 700; line-height: 22px; text-shadow: 0 1px 0 rgba(255,255,255,0.7); color: #4a1f3d; }
    .acts { display: flex; flex-direction: column; gap: 8px; width: 100%; }
    .ahead { display: flex; justify-content: space-between; align-items: center; font-size: 13px; gap: 8px; flex-wrap: wrap; }
    .moral { display: flex; align-items: center; gap: 4px; } .mt { font-style: normal; font-size: 11px; padding: 2px 6px; border-radius: 6px; background: #e8b4c6; color: #7a3a62; } .mt.on { background: #a6dfb2; color: #1d5a2c; } .mt.cur { outline: 2px solid #4a1f3d; font-weight: 800; }
    .qslots { display: flex; gap: 10px; align-items: stretch; }
    .qslot { position: relative; flex: 1; min-height: 64px; padding: 4px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: #fff2f6; border: 3px dashed #b8869b; border-radius: 10px; font-size: 12px; text-align: center; touch-action: none; }
    .qslot .qn { position: absolute; top: 2px; left: 6px; font-size: 10px; opacity: .6; } .qslot.free .qhint { font-size: 11px; opacity: .55; margin-top: 8px; }
    .qslot.free.hot, .aopts.hot { background: #d6f7ef; border-color: #2fb9a8; box-shadow: inset 0 0 0 2px #2fb9a8; } .qslot.free { transition: background .1s; }
    .qslot.full { border: 3px solid #4a1f3d; background: #fffafb; cursor: grab; } .qslot.full.run { border-color: #2fb9a8; background: #e3fbf6; cursor: default; } .qslot.full.dragging { opacity: .35; }
    .qslot img, .aopt img { width: 80px; height: 48px; image-rendering: pixelated; pointer-events: none; border: 2px solid #4a1f3d; border-radius: 6px; background: #fff; } .qslot b { font-size: 12px; line-height: 1.1; } .qslot small { font-size: 10px; opacity: .75; }
    .stars { display: inline-flex; gap: 3px; min-height: 8px; } .stars i { width: 7px; height: 7px; background: #f2c230; border: 1px solid #4a1f3d; transform: rotate(45deg); }
    .qx, .qstop { position: absolute; top: 2px; right: 3px; border: 0; background: none; font: 700 16px sans-serif; color: #b3261e; cursor: pointer; } .qstop { top: 2px; bottom: auto; right: 4px; font: 800 10px 'Pixelify Sans', sans-serif; color: #fff; background: #b3261e; border-radius: 6px; padding: 2px 6px; }
    .qslot.lock { background: #e8cbd6; border-style: solid; border-color: #c9a2b4; opacity: .75; }
    .aopt { position: relative; } .aopt.soir::after { content: ''; position: absolute; top: 4px; right: 5px; width: 11px; height: 11px; border-radius: 50%; background: transparent; box-shadow: inset -3px 0 0 0 #f2c230; transform: rotate(-20deg); } /* petite lune : tache possible le soir */
    .aopts-wrap { display: flex; align-items: stretch; gap: 4px; min-width: 0; } .aopts-wrap .aopts { flex: 1; min-width: 0; }
    .scrl { flex: none; width: 24px; padding: 0; border: 0; border-bottom: 3px solid #0f5a50; border-radius: 8px; background: #2fb9a8; color: #fff; font: 800 20px sans-serif; cursor: pointer; }
    .aopts { display: flex; gap: 8px; padding: 4px; border-radius: 10px; border: 2px solid transparent; overflow-x: auto; scroll-snap-type: x proximity; }
    .aopts .aopt { flex: 0 0 auto; min-width: 150px; scroll-snap-align: start; }
    .aopt { touch-action: pan-x; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; font: 700 12px 'Pixelify Sans', sans-serif; color: #4a1f3d; cursor: grab; background: #fff8fa; border: 2px solid #4a1f3d; border-radius: 10px; border-bottom-width: 4px; user-select: none; }
    .aopt:hover:not(:disabled) { background: #ffd9e5; } .aopt:disabled { opacity: .55; cursor: not-allowed; } .aopt small { font-size: 10px; opacity: .8; } .aopt em { font-size: 10px; color: #b3261e; font-style: normal; }
    .aopt > span { display: flex; justify-content: center; align-items: center; flex-wrap: nowrap; white-space: nowrap; } /* les recompenses restent sur une seule ligne */
    .aopt .amt { margin: 0 2px; font-size: 12px; white-space: nowrap; display: inline-flex; align-items: center; } .aopt .amt .ico { margin-right: 1px; }
    .dragghost { position: fixed; z-index: 99999; width: 96px; height: 58px; margin: -29px 0 0 -48px; border: 2px solid #4a1f3d; border-radius: 6px; image-rendering: pixelated; pointer-events: none; filter: drop-shadow(0 4px 4px rgba(0,0,0,.5)); }
    .collect { min-width: 200px; padding: 8px 26px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #fff; border: 0;
      background: linear-gradient(#3fcfbd, var(--orange)); border-bottom: 5px solid var(--orange-dark); border-radius: 10px; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
    .collect .cl { font-size: 17px; font-weight: 700; letter-spacing: .04em; }
    .collect:disabled { background: #b8869b; border-bottom-color: #7a5a6a; opacity: 0.8; cursor: not-allowed; }
    .collect small { font-size: 11px; opacity: 0.9; }
    .amt { font-size: 16px; font-weight: 800; margin: 0 8px; } .amt.ok { color: #2f7a3d; } .amt.ko { color: #b3261e; }
    .stats { display: flex; justify-content: center; gap: 28px; margin-top: 10px; }
    .stat { display: flex; flex-direction: column; align-items: center; } .stat b { font-size: 17px; } .stat small { font-size: 11px; opacity: 0.7; }
    .amt.ko { background: #ffe0dc; border: 2px solid #b3261e; border-radius: 10px; padding: 0 6px; } .amt .miss { display: block; font-size: 10px; font-weight: 700; color: #b3261e; line-height: 1; margin-top: -1px; } .need .amt.ko { display: inline-flex; flex-direction: column; align-items: center; }
    .whyno { margin-top: 3px; font-size: 12px; font-weight: 800; color: #b3261e; }
    .cl2 { font-size: 15px; font-weight: 800; } .need { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 2px 4px; }
    .info2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
    .icard { padding: 8px 10px 9px; background: #fffafb; border: 2px solid #4a1f3d; border-radius: 12px; box-shadow: 0 3px 0 #4a1f3d; text-align: left; }
    .icard h4 { margin: -16px 0 6px; padding: 1px 8px; display: inline-block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #fff2f6; background: #4a1f3d; border-radius: 6px; }
    .icard p { margin: 3px 0; font-size: 13px; line-height: 1.3; } .icard .sub { font-size: 11px; opacity: .7; } .icard .joke { margin-top: 5px; padding-top: 4px; border-top: 2px dotted #e3b6c8; font-style: italic; color: #8a3a62; }
    .icard.wide { grid-column: 1 / -1; } .eqrow { display: flex; align-items: center; gap: 10px; } .eqface { width: 40px; height: 40px; image-rendering: pixelated; border: 2px solid #4a1f3d; border-radius: 8px; background: #cfe3ee; } .eqrow small { display: block; font-size: 11px; opacity: .7; } .eqrow .phire { margin-left: auto; }
    .icard .ico { margin: 0 3px 0 0; } .icard b { font-size: 14px; }
    /* fiche d'un batiment : un fil de lecture, des filets entre les parties, pas de cases */
    .fiche { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; width: 100%; text-align: left; color: #4a1f3d; }
    .fiche .fcol { display: flex; flex-direction: column; min-width: 0; } .fiche .fs { padding: 7px 0 8px; } .fiche .fs + .fs { border-top: 2px dotted #d9a9bd; }
    .fiche h6 { margin: 0 0 5px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #8a3a62; } .fiche p { margin: 3px 0; font-size: 13px; line-height: 1.3; } .fiche .sub { font-size: 11px; opacity: .7; } .fiche .joke { font-style: italic; color: #8a3a62; }
    .fiche .gains { display: flex; flex-wrap: wrap; gap: 8px 14px; } .fiche .gn { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 56px; text-align: center; } .fiche .gn b { font-size: 12px; }
    .fiche .gi { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 2px solid #e3b6c8; } .fiche .gi .ico { width: 26px; height: 26px; margin: 0; }
    .fiche .gn.uni { min-width: 84px; } .fiche .gn.uni .gi { width: 56px; height: 56px; border: 3px solid #e0a800; background: radial-gradient(#fff6cf, #ffe18a); box-shadow: 0 0 0 4px rgba(240,179,35,.35), 0 0 14px rgba(240,179,35,.7); } .fiche .gn.uni .gi .ico { width: 38px; height: 38px; } .fiche .gn.uni b { font-size: 14px; }
    .fiche .gn em { padding: 0 7px; font-style: normal; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: #c79a00; border-radius: 8px; } .fiche .unote { padding: 4px 8px; background: #fff3c4; border-left: 4px solid #e0a800; border-radius: 0 8px 8px 0; font-size: 12px; }
    .fiche .fs.uni h6 { color: #a87400; } .fiche .tp { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; } .fiche .tp .ico { width: 20px; height: 20px; margin: 0; }
    .fiche .capr { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; } .fiche .capr .big { font-size: 26px; line-height: 1; } .fiche .capb { flex: 1 0 100%; height: 6px; background: #ecd5df; border-radius: 3px; overflow: hidden; } .fiche .capb u { display: block; height: 100%; background: #2fb9a8; }
    .fiche .trk { display: flex; align-items: flex-start; margin: 2px 0 6px; } .fiche .td { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; } .fiche .td::before { content: ''; position: absolute; top: 6px; left: -50%; right: 50%; height: 3px; background: #e3b6c8; } .fiche .td:first-child::before { display: none; } .fiche .td.on::before, .fiche .td.now::before { background: #2fb9a8; }
    .fiche .td i { position: relative; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 2.5px solid #e3b6c8; box-sizing: border-box; } .fiche .td.on i { background: #2fb9a8; border-color: #1f8a7c; } .fiche .td.now i { width: 17px; height: 17px; margin-top: -2px; background: #f2c230; border-color: #4a1f3d; box-shadow: 0 0 0 3px rgba(242,194,48,.4); } .fiche .td small { font-size: 9px; opacity: .7; margin-top: 2px; }
    .fiche .eqrow { display: flex; align-items: center; gap: 10px; } .fiche .eqrow small { display: block; font-size: 11px; opacity: .7; } .fiche .eqrow .phire { margin-left: auto; }
    #panel.phone .fiche { gap: 2px 16px; overflow-y: auto; max-height: 100%; align-content: start; } #panel.phone .fiche p { font-size: 12px; margin: 2px 0; } #panel.phone .fiche .gi { width: 34px; height: 34px; } #panel.phone .fiche .gn.uni .gi { width: 46px; height: 46px; }
    .empty, .info { text-align: center; padding: 14px; font-size: 15px; line-height: 1.5; } .meta { opacity: 0.6; font-size: 12px; }
    #build-menu .build-item small { opacity: .7; margin-left: 6px; }
    .round {
      position: fixed; z-index: 4; width: 66px; height: 66px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer;
      background: #f7cfdc; border: 4px solid #4a1f3d; padding: 0;
      box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 3px 5px rgba(255,255,255,0.6);
    }
    .round:hover, .round.on { background: #ffd0e0; }
    .round svg { width: 34px; height: 34px; }
    .round.big { width: 88px; height: 88px; } .round.big .face { width: 48px; height: 48px; } .round.big svg { width: 56px; height: 56px; }
    #build-toggle { right: 16px; bottom: 14px; }
    #view-toggle { right: 116px; bottom: 14px; } #shop-toggle { right: 202px; bottom: 14px; }
    #steps-toggle { left: 14px; bottom: 14px; }
    #pupils-toggle { left: 92px; bottom: 14px; } #staff-toggle { left: 170px; bottom: 14px; } #cal-toggle { left: 248px; bottom: 14px; } #pass-toggle { left: 326px; bottom: 14px; display: none; } #pass-toggle.show { display: flex; } #school-toggle { left: 404px; bottom: 14px; }
    #tuto { position: fixed; inset: 0; z-index: 9; pointer-events: none; font-family: 'Pixelify Sans', 'Segoe UI', sans-serif; } #tuto.dim { background: rgba(30,10,30,.3); }
    #tuto-spot { display: none; position: absolute; border: 3px solid #ffd93d; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(30,10,30,.5), 0 0 16px #ffd93d; animation: tpulse 1.2s ease-in-out infinite; pointer-events: none; }
    @keyframes tpulse { 50% { box-shadow: 0 0 0 9999px rgba(30,10,30,.5), 0 0 28px 6px #ffd93d; } }
    #tuto-box { position: absolute; left: 66px; right: 12px; bottom: 96px; max-width: 640px; display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; background: #ffe4ec; color: #4a1f3d; border: 3px solid #4a1f3d; border-radius: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.5); pointer-events: auto; font-size: 14px; line-height: 1.35; }
    #tuto-box.mid { left: 50%; right: auto; bottom: auto; top: 50%; width: min(640px, calc(100vw - 140px)); transform: translate(-50%, -50%); }
    #tuto-box.top { bottom: auto; top: 64px; } #tuto-face { width: 54px; height: 54px; object-fit: cover; image-rendering: pixelated; background: #cfe3ee; border: 2px solid #4a1f3d; border-radius: 10px; } .kw { color: #b0306a; font-weight: 700; }
    #tuto-next { width: 40px; height: 40px; font: 700 26px/1 sans-serif; color: #fff; cursor: pointer; background: #2fb9a8; border: 0; border-bottom: 4px solid #0f5a50; border-radius: 12px; animation: tpulse2 1s infinite; } @keyframes tpulse2 { 50% { transform: translateX(3px); } }
    #tuto-skip { position: absolute; right: 8px; top: -26px; font: 700 12px 'Pixelify Sans', sans-serif; color: #fff; background: rgba(74,31,61,.85); border: 0; border-radius: 8px; padding: 3px 8px; cursor: pointer; }
    #obj-toggle { position: fixed; left: 10px; top: 136px; z-index: 3; width: 64px; height: 64px; border-radius: 50%; padding: 0; cursor: pointer; background: #f7cfdc; border: 3px solid #4a1f3d; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
    #obj-toggle .face { width: 56px; height: 56px; display: block; margin: 0 auto; border-radius: 50%; background: #cfe3ee center / cover no-repeat;  }
    #obj-toggle::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; } /* zone de toucher plus large que le dessin */
    #obj-badge { position: absolute; right: -6px; top: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: #b3261e; color: #fff; font: 800 12px 'Pixelify Sans', sans-serif; line-height: 20px; text-align: center; border: 2px solid #fff; }
    .oera-head { margin: 2px 0 8px; } .obar { position: relative; height: 18px; background: #e8b4c6; border: 2px solid #4a1f3d; border-radius: 9px; overflow: hidden; } .obar i { display: block; height: 100%; background: #2fb9a8; } .obar span { position: absolute; inset: 0; text-align: center; font: 800 12px/14px 'Pixelify Sans', sans-serif; color: #4a1f3d; } .obar.big { height: 22px; margin-top: 4px; } .obar.big span { line-height: 18px; }
    .objs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
    #m-body .objs li.obj { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 6px 8px; background: #fff8fa; border: 2px solid #4a1f3d; border-radius: 10px; text-align: left; border-bottom: 2px solid #4a1f3d; }
    .obj.ready { background: #e3fbf6; border-color: #0f5a50; } .obj.done { opacity: .55; } .obj .otxt b { font-size: 13px; } .obj .orew { display: flex; flex-direction: column; } .obj .orew .amt { font-size: 12px; margin: 0; } .otick { font-size: 22px; color: #2f7a3d; }
    .sch-go.oalt { background: #b0306a; border-bottom-color: #7a1f4a; }
    .oeras { display: flex; gap: 6px; justify-content: center; margin-top: 8px; flex-wrap: wrap; } .oera { padding: 4px 10px; font-size: 12px; background: #e8cbd6; border: 2px solid #c9a2b4; border-radius: 8px; color: #7a5a6a; }
    #humour { position: fixed; left: 0; top: 0; z-index: 3; max-width: 190px; padding: 4px 8px; font: 600 11px/1.25 'Pixelify Sans', sans-serif; color: #4a1f3d; background: #fffafb; border: 2px solid #4a1f3d; border-radius: 9px; box-shadow: 0 2px 5px rgba(0,0,0,.35); cursor: pointer; pointer-events: auto; }
    #humour:after { content: ''; position: absolute; left: calc(50% + var(--tail, 0px) - 6px); bottom: -8px; border: 6px solid transparent; border-top: 7px solid #4a1f3d; border-bottom: 0; }
    #settings-toggle { position: fixed; right: 8px; top: 8px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; font-size: 22px; line-height: 1; color: #4a1f3d; cursor: pointer; background: #f7cfdc; border: 3px solid #4a1f3d; padding: 0; }
    .set-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid rgba(74,31,61,.2); font-size: 14px; text-align: left; } .set-row input[type=range] { width: 130px; accent-color: #2fb9a8; } .set-row input[type=checkbox] { width: 22px; height: 22px; accent-color: #2fb9a8; }
    .round .face { width: 38px; height: 38px; background: center / contain no-repeat; }
    .round .badge { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); min-width: 44px; padding: 1px 6px; font: 800 12px 'Pixelify Sans', sans-serif;
      color: #fff2f6; background: #4a1f3d; border: 2px solid #4a1f3d; border-radius: 10px; text-align: center; }
    #modal { position: fixed; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; background: rgba(5,15,22,0.6); }
    #modal.hidden { display: none; }
    .mbox { position: relative; width: min(440px, 92vw); max-height: 88vh; overflow-y: auto; border-radius: 14px; border: 3px solid #4a1f3d; background: #f7cfdc;
      box-shadow: 0 10px 30px rgba(0,0,0,0.55); font-family: 'Pixelify Sans', 'Segoe UI', sans-serif; color: #4a1f3d; text-align: center; padding-bottom: 14px; }
    .mbanner { height: 28px; border-radius: 11px 11px 0 0; background: repeating-linear-gradient(90deg, #b0306a 0 16px, #c0407a 16px 32px); }
    .mribbon { margin: 12px 14px 12px; padding: 8px 16px; font-size: 18px; font-weight: 700; letter-spacing: .03em; color: #fff2f6; background: #4a1f3d;
      border: 2px solid #4a1f3d; border-radius: 4px; box-shadow: 0 3px 5px rgba(0,0,0,0.3); text-transform: uppercase; }
    #m-body { padding: 4px 18px 6px; font-size: 14px; line-height: 1.5; }
    #m-body ul { list-style: none; margin: 0; padding: 0; text-align: left; background: rgba(90,58,20,0.1); border-radius: 10px; }
    #m-body li { padding: 7px 12px; border-bottom: 1px solid rgba(90,58,20,0.2); } #m-body li:last-child { border: 0; }
    #m-body li small { display: block; font-size: 12px; opacity: .8; } #m-body li.ok { opacity: .9; } #m-body li.todo b { color: #b0306a; }
    .sch-tab { padding: 6px 12px; font: 800 14px 'Pixelify Sans', sans-serif; color: #4a1f3d; cursor: pointer; background: #fff2f6; border: 2px solid #4a1f3d; border-radius: 8px; } .sch-tab.on { color: #fff; background: #2fb9a8; border-color: #0f5a50; }
    .sch-go { margin-top: 4px; padding: 5px 12px; font: 800 13px 'Pixelify Sans', sans-serif; color: #fff; cursor: pointer; background: #2fb9a8; border: 0; border-bottom: 3px solid #0f5a50; border-radius: 8px; } .sch-go:disabled { background: #b8869b; border-bottom-color: #7a5a6a; cursor: not-allowed; }
    #m-body li.now { background: rgba(232,137,43,0.35); font-weight: 800; } #m-body li.done { opacity: .75; }
    .mx { position: absolute; top: -6px; right: 10px; width: 36px; height: 40px; font-size: 22px; font-weight: 700; color: #fff; cursor: pointer; border: 0;
      background: #b0306a; clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%); }
    .mok { margin: 12px auto 0; display: block; min-width: 180px; padding: 9px 30px 7px; font-size: 17px; font-weight: 700; color: #fff; cursor: pointer; border: 0;
      background: #2fb9a8; border-bottom: 5px solid #0f5a50; border-radius: 10px; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
    #build-menu, #view-menu { position: fixed; z-index: 4; display: none; font-family: 'Pixelify Sans', 'Segoe UI', sans-serif; color: #4a1f3d; }
    #build-menu.open { display: block; left: 8px; right: 8px; bottom: 112px; background: #f7cfdc;
      border: 3px solid #4a1f3d; border-radius: 14px; padding: 8px 12px 12px; box-shadow: 0 -4px 18px rgba(0,0,0,0.5); }
    #build-menu.open { display: block; padding: 8px 10px 10px; }
    #build-menu .bm-row { display: flex; gap: 8px; align-items: stretch; overflow-x: auto; padding-bottom: 6px; } #build-menu .bm-row .cards { flex: none; overflow: visible; padding-bottom: 0; }
    #build-menu .bm-cat { position: relative; flex: none; width: clamp(88px, 14vw, 128px); min-height: 150px; padding: 0; border: 3px solid #4a1f3d; border-radius: 10px; overflow: hidden; background: #fdeaf1 center / cover no-repeat; cursor: pointer; font: inherit; color: #fff; filter: saturate(.8) brightness(.9); }
    #build-menu .bm-cat.on { filter: none; box-shadow: 0 0 0 2px #fff4f8, 0 0 0 4px #4a1f3d; } #build-menu .bm-cat .nm { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 3px; background: rgba(74, 31, 61, .92); font-size: 12px; font-weight: 800; text-align: center; } #build-menu .bm-cat.on .nm { background: #c9742a; }
    #build-menu .bm-close { position: absolute; top: -12px; right: 8px; width: 28px; height: 28px; font-size: 18px; font-weight: 700; color: #4a1f3d; cursor: pointer; border-radius: 8px; background: #fff2f6; border: 2px solid #4a1f3d; z-index: 2; }
    #build-menu .bm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 800; letter-spacing: .06em; }
    #build-menu .bm-close { width: 30px; height: 30px; font-size: 20px; font-weight: 700; color: #4a1f3d; cursor: pointer; border-radius: 6px;
      background: #fff2f6; border: 2px solid #4a1f3d; }
    #build-menu .bm-tabs { display: flex; gap: 6px; }
    #build-menu .bm-tab { padding: 3px 10px; font: 800 12px 'Pixelify Sans', sans-serif; letter-spacing: .04em; color: #4a1f3d; background: #fff2f6; border: 2px solid #4a1f3d; border-radius: 8px; cursor: pointer; }
    #build-menu .bm-tab.on { color: #fff; background: #2fb9a8; border-color: #0f5a50; }
    #build-menu .cards { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
    .card { flex: 0 0 150px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 8px 10px; border-radius: 10px;
      background: #fffafb; border: 2px solid #4a1f3d; }
    .card img { width: 128px; height: 88px; object-fit: contain; background: #ffe4ec; border-radius: 8px; }
    .card .nm { font-size: 13px; font-weight: 800; text-align: center; min-height: 32px; display: flex; align-items: center; }
    .card .sz { font-size: 11px; opacity: 0.65; }
    .card .cost { font-size: 13px; font-weight: 800; display: flex; align-items: center; min-height: 18px; }
    .card .go { width: 100%; padding: 5px 0 3px; font-size: 13px; font-weight: 700; letter-spacing: .04em; color: #fff; cursor: pointer; border: 0;
      background: linear-gradient(#3fcfbd, var(--orange)); border-bottom: 4px solid var(--orange-dark); border-radius: 8px; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
    .card .go:disabled { background: #b8869b; border-bottom-color: #7a5a6a; opacity: .75; cursor: not-allowed; }
    #build-menu .cards::-webkit-scrollbar { height: 8px; } #build-menu .cards::-webkit-scrollbar-track { background: rgba(90,58,20,0.1); border-radius: 4px; }
    #build-menu .cards::-webkit-scrollbar-thumb { background: #4a1f3d; border-radius: 4px; }
    .card.done { opacity: 0.7; } .card.locked { opacity: 0.5; filter: grayscale(0.7); }
    @media (max-height: 520px) { #build-menu.open { bottom: 6px; } #build-menu .bm-main { padding: 6px 10px 8px; } #build-menu .bm-head { margin-bottom: 5px; } .card { flex-basis: 118px; gap: 2px; padding: 5px 5px 7px; } .card img { width: 100px; height: 58px; } .card .nm { font-size: 12px; min-height: 26px; } .card .sz { font-size: 10px; } .card .cost { font-size: 12px; min-height: 14px; } .card .go { padding: 4px 0 2px; font-size: 12px; } }

    .card.next { border-color: #2fb9a8; box-shadow: 0 0 10px rgba(232,137,43,0.5); }
    #view-menu.open { display: flex; flex-direction: column; gap: 6px; right: 116px; bottom: 92px; background: #f7cfdc; border: 3px solid #4a1f3d;
      border-radius: 12px; padding: 10px; min-width: 220px; max-height: 70vh; overflow-y: auto; }
    .build-item {
      font-family: 'Pixelify Sans', 'Segoe UI', sans-serif; font-size: 13.5px; font-weight: 700; text-align: left;
      background: #fff2f6; color: #4a1f3d; border: 2px solid #4a1f3d; border-radius: 8px;
      padding: 8px 12px; cursor: pointer; white-space: nowrap;
    }
    .build-item:hover { background: #ffd9e5; }
    .build-item.active { background: #2fb9a8; color: #fff; border-color: #0f5a50; }
    .menu-section-label {
      font-family: 'Pixelify Sans', 'Segoe UI', sans-serif; font-size: 11px; font-weight: 800; color: #7a3a62; text-transform: uppercase;
      letter-spacing: .04em; margin: 6px 2px 0; padding-top: 4px; border-top: 1px solid #e8b4c6;
    }
    .menu-section-label:first-child { border-top: none; margin-top: 0; padding-top: 0; }
      @media (max-width: 1000px), (max-height: 520px) { /* fiche d'un batiment sur telephone : carte d'en-tete plus compacte (apres les regles de base) */
      #panel-head { top: 56px; padding: 6px 12px 8px; } #panel-name { font-size: 19px; margin: 3px 0 4px; } #panel-new { margin-top: 5px; padding: 3px 7px 4px; font-size: 12px; } #panel-new .newtag { margin-bottom: 0; }
    }

    /* fenetres (Mon ecole, Reglages, Changer...) sur telephone en paysage : plus larges, entetes compacts, onglets sur une ligne qui s'adapte, listes sur deux colonnes : rien ne depasse */
    @media (max-height: 520px), (max-width: 1000px) {
      .mbox { width: min(760px, 96vw); max-height: 96vh; overflow-x: hidden; padding-bottom: 8px; }
      .mbanner { height: 16px; } .mribbon { margin: 6px 12px 6px; padding: 4px 12px; font-size: 15px; }
      #m-body { padding: 2px 12px 4px; font-size: 13px; line-height: 1.35; }
      #m-body > div[style*="justify-content:center"] { flex-wrap: wrap; gap: 4px !important; margin-bottom: 4px !important; }
      .sch-tab { padding: 4px 9px; font-size: 12px; }
      #m-body ul { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: none; }
      #m-body ul li { background: rgba(255,255,255,.45); border: 2px solid #e3b6c8; border-radius: 10px; min-width: 0; } #m-body ul li:last-child { border: 2px solid #e3b6c8; }
      #m-body ul li.obj { grid-template-columns: 1fr auto auto; }
      .cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; } .cgrid .ccard { grid-template-columns: 46px 1fr; margin: 4px 0; } .cgrid .ccard img { width: 44px; height: 44px; } .cgrid .cright { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; flex-wrap: wrap; }
    }
    /* fiche d'un batiment sur telephone : RIEN ne defile verticalement ; seules les rangees (taches, cartes d'infos) defilent a gauche et a droite */
    #panel.phone #panel-body { overflow: hidden !important; }
    #panel.phone #panel-head { display: flex !important; align-items: center; flex-wrap: wrap; gap: 3px 10px; padding: 5px 12px 6px !important; }
    #panel.phone #panel-name { margin: 0 !important; font-size: 18px !important; } #panel.phone #panel-meta { margin: 0 !important; }
    #panel.phone #panel-new { flex-basis: 100%; }
    #panel-aux { display: none; } #panel.phone #panel-aux { display: block; flex-basis: 100%; } #panel.phone #panel-aux .ahead { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px !important; align-items: center; margin: 0 !important; } #panel.phone #panel-aux .ahead .mt { font-size: 10px; }
    #panel.phone .qslot b { font-size: 12px !important; } #panel.phone .qslot small { font-size: 10px !important; } #panel.phone .aopt em { font-size: 10px !important; }
    #panel.phone .aopts .aopt { min-width: 250px !important; max-width: 270px !important; padding: 3px 6px !important; }
    #panel.phone .aopt b, #panel.phone .aopt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    #panel.phone .acts { gap: 5px; } #panel.phone .ahead { font-size: 12px; flex-wrap: nowrap; white-space: nowrap; } #panel.phone .mt { font-size: 10px; padding: 1px 5px; }
    #panel.phone .qslots { gap: 6px; }
    #panel.phone .qslot { min-height: 0; height: 58px; padding: 12px 4px 3px; display: grid; grid-template-columns: 54px 1fr; column-gap: 6px; align-items: center; justify-items: start; text-align: left; border-width: 2px; }
    #panel.phone .qslot.free, #panel.phone .qslot.lock { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3px 4px; }
    #panel.phone .qslot.free .qhint { margin-top: 6px; }
    #panel.phone .qslot img { width: 54px; height: 32px; grid-row: 1 / 4; border-width: 1px; } #panel.phone .qslot .stars { display: none; }
    #panel.phone .qslot b { font-size: 11px; } #panel.phone .qslot small { font-size: 9px; }
    #panel.phone .collect { min-width: 120px; padding: 4px 12px 3px; } #panel.phone .collect .cl { font-size: 14px; } #panel.phone .collect small { font-size: 10px; }
    #panel.phone .aopts { gap: 6px; padding: 3px; scrollbar-width: none; } #panel.phone .aopts::-webkit-scrollbar { display: none; }
    #panel.phone .aopts .aopt { min-width: 210px; max-width: 230px; display: grid; grid-template-columns: 62px 1fr; column-gap: 7px; row-gap: 1px; align-items: center; justify-items: start; text-align: left; padding: 4px 6px; }
    #panel.phone .aopt img { grid-row: 1 / 5; width: 62px; height: 37px; } #panel.phone .aopt .stars { grid-column: 1; grid-row: 5; justify-self: center; }
    #panel.phone .aopt > span:not(.stars) { justify-content: flex-start; } #panel.phone .aopt em { font-size: 9px; line-height: 1.1; grid-column: 2; }
    #panel.phone .info2 { display: flex; gap: 10px; overflow-x: auto; padding: 18px 2px 4px; scrollbar-width: thin; align-items: stretch; }
    #panel.phone .icard, #panel.phone .icard.wide { flex: 0 0 240px; } #panel.phone .icard p { font-size: 12px; margin: 2px 0; }
    /* rendu doux (reglage) : les petites images (visages, scenes des taches, icones) sont lissees au lieu d'etre agrandies en gros pixels */
    body.soft img { image-rendering: auto !important; }
  
    /* fiche d'amelioration : image a gauche, effets et couts a droite */
    #panel .up2 { display: grid; grid-template-columns: 36% 1fr; gap: 10px; align-items: start; }
    #panel .upimg { position: relative; background: #ffe4ec; border-radius: 10px; border: 2px solid #4a1f3d; min-height: 90px; display: flex; align-items: center; justify-content: center; }
    #panel .upimg img { width: 100%; max-height: 110px; object-fit: contain; }
    #panel .upimg .ulv { position: absolute; left: 6px; top: 5px; padding: 1px 8px; font: 800 11px 'Pixelify Sans', sans-serif; color: #fff; background: #2fb9a8; border-radius: 8px; border: 2px solid #0f5a50; }
    #panel .upfx { margin: 0 0 6px; padding-left: 16px; font-size: 12px; line-height: 1.25; }
    #panel .upfx li { margin: 2px 0; }

    /* explication d'un evenement (Halloween) : la bulle de Colette prend les couleurs de la fete */
    #tuto[data-theme="halloween"] #tuto-box { background: #26103a !important; color: #ffe9c9 !important; border-color: #f28a1e !important; }
    #tuto[data-theme="halloween"] #tuto-box .kw { color: #ffbe5c !important; }
    #tuto[data-theme="halloween"] #tuto-next { background: #ff9a2e !important; border-bottom-color: #a85a12 !important; color: #26103a !important; }
    #tuto[data-theme="halloween"] #tuto-spot { border-color: #ff9a2e; box-shadow: 0 0 0 9999px rgba(10,4,20,.6), 0 0 16px #ff9a2e; }

    /* illustration d'un menu (en chantier) : une scene douce avec le pictogramme du menu entre deux plots */
    .mart { position: relative; grid-column: 1 / -1; display: flex; align-items: flex-end; justify-content: center; gap: 14px; height: 92px; margin: 0 0 10px; padding: 8px 10px 6px; box-sizing: border-box; border: 3px solid #4a1f3d; border-radius: 14px; overflow: hidden;
      background: linear-gradient(#ffe1ec 0%, #fdeed5 62%, #e9c88a 62%, #e9c88a 100%); box-shadow: 0 3px 0 #4a1f3d; }
    .mart::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 9px; background: repeating-linear-gradient(135deg, #f6c230 0 10px, #4a1f3d 10px 20px); }
    .mart .mi { width: 72px; height: 72px; margin-bottom: 4px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.25)); } .mart .mc { width: 40px; height: 40px; margin-bottom: 8px; } .mart .mc.r { transform: scaleX(-1); }
    .mart .mtag { position: absolute; top: 7px; left: 50%; transform: translateX(-50%); padding: 1px 12px; font: 800 11px 'Pixelify Sans', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: #e8476e; border: 2px solid #4a1f3d; border-radius: 10px; white-space: nowrap; }
    .mart.ban { display: block; height: auto; padding: 0; background: none; } .mart.ban::after { display: none; } .mart .mban { display: block; width: 100%; height: clamp(84px, 25vh, 150px); object-fit: cover; object-position: 50% 55%; }
    @media (max-height: 520px) { .mart { height: 70px; margin-bottom: 6px; } .mart .mi { width: 54px; height: 54px; } .mart .mc { width: 30px; height: 30px; } .mart .mtag { top: 4px; font-size: 10px; } }

    /* les eleves d'une classe : visages dans l'entete de la production, grille dans la fiche */
    .kids { display: inline-flex; align-items: center; gap: 0; } .kids b { margin: 0 6px 0 3px; } .kids img { width: 24px; height: 24px; margin-left: -7px; border-radius: 50%; background: #fff; } .kids img:first-of-type { margin-left: 0; } .kids small { margin-left: 4px; font-weight: 800; }
    .kgrid { display: flex; flex-wrap: wrap; gap: 6px 4px; } .kid { display: flex; flex-direction: column; align-items: center; width: 46px; } .kid img { width: 38px; height: 38px; } .kid small { font-size: 9px; line-height: 1.1; max-width: 46px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* Mon ecole : une image verticale a gauche (elle change avec le sous-menu), les onglets defilent vers la droite */
    .schlay { display: flex; gap: 10px; align-items: flex-start; } .schleft { flex: 0 0 clamp(92px, 15vw, 150px); position: sticky; top: 0; }
    .schleft .mart { margin: 0; height: min(260px, 64vh); padding: 0; } .schleft .mart .mban { height: 100%; width: 100%; object-fit: cover; object-position: 50% 50%; }
    .schright { flex: 1; min-width: 0; } .schright > div[style*="justify-content:center"] { flex-wrap: nowrap !important; overflow-x: auto; justify-content: flex-start !important; padding-bottom: 4px; } .schright .sch-tab { flex: none; white-space: nowrap; }
    .schlay .shbanner { display: none; }

    /* Mon ecole : des bandes verticales sur toute la hauteur ; la bande ouverte montre son contenu a sa droite */
    .schrow { display: flex; gap: 8px; align-items: stretch; overflow-x: auto; height: calc(100vh - 150px); min-height: 190px; padding-bottom: 4px; }
    .schstrip { position: relative; flex: none; width: clamp(66px, 9vw, 96px); padding: 0; border: 3px solid #4a1f3d; border-radius: 10px; overflow: hidden; background: #fdeaf1 center / cover no-repeat; cursor: pointer; font: inherit; color: #fff; filter: saturate(.8) brightness(.9); }
    .schstrip.on { filter: none; box-shadow: 0 0 0 2px #fff4f8, 0 0 0 4px #4a1f3d; } .schstrip .nm { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 2px; background: rgba(74, 31, 61, .92); font-size: 11.5px; font-weight: 800; text-align: center; line-height: 1.1; } .schstrip.on .nm { background: #c9742a; }
    .schpanel { flex: none; width: clamp(400px, 72vw, 680px); height: 100%; overflow-y: auto; padding: 2px 6px 6px 2px; box-sizing: border-box; } .schpanel .shbanner { display: none; }

    /* harmonisation avec les illustrations : papier chaud, contours prune adoucis, coins plus ronds, titres en Fredoka (les nombres restent en pixel) */
    .mbox { background: linear-gradient(#fbe9e1, #f6d9d6); border-color: #5c3350; border-radius: 18px; box-shadow: 0 12px 34px rgba(40, 15, 35, .5), inset 0 0 0 2px rgba(255, 255, 255, .35); }
    .mbanner { height: 12px; background: linear-gradient(90deg, #c98aa6, #dcaabd, #c98aa6); border-radius: 15px 15px 0 0; }
    .mribbon { font-family: Fredoka, 'Pixelify Sans', sans-serif; text-transform: none; font-size: 19px; letter-spacing: .01em; background: #5c3350; border-color: #5c3350; border-radius: 12px; box-shadow: 0 3px 0 rgba(40, 15, 35, .35); }
    #build-menu.open { background: #f9e4dc; border-color: #5c3350; border-radius: 16px; }
    #modal.withart .mribbon { display: none; } #modal.withart .mbanner { height: 8px; } .mart.ban { position: relative; } .mart .mtitle { position: absolute; left: 0; right: 0; bottom: 0; padding: 5px 10px; background: rgba(92, 51, 80, .88); color: #fff; font: 700 19px Fredoka, 'Pixelify Sans', sans-serif; text-align: center; border-radius: 0 0 9px 9px; text-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
    @media (max-height: 520px) { .mart .mtitle { font-size: 16px; padding: 3px 8px; } #modal.withart #m-body { padding-top: 6px; } }

    /* les bandes prennent toute la largeur de l ecran : fermees, elles se partagent la ligne ; une ouverte, les autres se resserrent et son contenu prend le reste */
    .schrow:not(:has(.schpanel)) .schstrip { flex: 1 1 0; width: auto; }
    .schrow:has(.schpanel) .schstrip { flex: 0 0 clamp(56px, 8vw, 76px); } .schrow:has(.schpanel) .schstrip .nm { font-size: 10px; padding: 5px 1px; }
    .schpanel { flex: 1 1 360px; width: auto; min-width: 340px; }
    #build-menu .bm-row:not(:has(.cards)) .bm-cat { flex: 1 1 0; width: auto; }

    /* la bande ouverte est tout a gauche ; son contenu prend l espace ; les autres bandes sont de fines bandes a droite (nom a la verticale) */
    .schrow:has(.schpanel) .schstrip.on { flex: 0 0 clamp(70px, 10vw, 92px); }
    .schrow:has(.schpanel) .schstrip:not(.on) { flex: 0 0 42px; } .schrow:has(.schpanel) .schstrip:not(.on) .nm { top: 0; padding: 0; display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; transform: rotate(180deg); background: rgba(74, 31, 61, .72); font-size: 11px; }
    .schpanel { flex: 1 1 0; min-width: 300px; }
    #build-menu .bm-row:has(.cards) .bm-cat.on { flex: none; } #build-menu .bm-row .cards { flex: 1 1 0; min-width: 0; overflow-x: auto; overflow-y: hidden; }
    #build-menu .bm-row:has(.cards) .bm-cat:not(.on) { flex: 0 0 42px; width: 42px; min-height: 0; } #build-menu .bm-row:has(.cards) .bm-cat:not(.on) .nm { top: 0; padding: 0; display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; transform: rotate(180deg); background: rgba(74, 31, 61, .72); font-size: 11px; }

    /* la croix de fermeture : dans la fenetre (elle etait coupee en haut), au-dessus du bandeau, en rond bien visible */
    .mx { top: 8px !important; right: 8px !important; width: 36px !important; height: 36px !important; padding: 0; border-radius: 50%; clip-path: none !important; background: #fff4f8 !important; color: #5c3350 !important; border: 3px solid #5c3350 !important; font-size: 22px !important; font-weight: 800; line-height: 1; z-index: 9; box-shadow: 0 2px 0 rgba(40, 15, 35, .35); display: flex; align-items: center; justify-content: center; }
    #modal.withart .mart.ban { margin-top: 0; }

    /* Boutique : l'illustration de gauche va du haut au bas de la fenetre ; le titre, le contenu et OK sont a droite (rien a faire defiler en paysage de telephone) */
    #modal:has(.schrow > button.schstrip.on:only-of-type) .mbox { display: grid; grid-template-columns: clamp(92px, 15vw, 150px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; width: min(900px, 97vw); height: min(420px, 94vh); max-height: none; padding: 0 0 6px; overflow: hidden; }
    #modal:has(.schrow > button.schstrip.on:only-of-type) .mbanner { display: none; }
    #modal:has(.schrow > button.schstrip.on:only-of-type) .mribbon { grid-column: 2; grid-row: 1; margin: 8px 56px 6px 10px; }
    #modal:has(.schrow > button.schstrip.on:only-of-type) #m-body, #modal:has(.schrow > button.schstrip.on:only-of-type) .schrow { display: contents; }
    #modal:has(.schrow > button.schstrip.on:only-of-type) .schstrip.on { grid-column: 1; grid-row: 1 / span 3; width: auto; flex: none; border-width: 0 3px 0 0; border-radius: 0; box-shadow: none; }
    #modal:has(.schrow > button.schstrip.on:only-of-type) .schpanel { grid-column: 2; grid-row: 2; height: auto; min-height: 0; min-width: 0; overflow-y: auto; padding: 0 12px 2px 10px; }
    #modal:has(.schrow > button.schstrip.on:only-of-type) .mok { grid-column: 2; grid-row: 3; justify-self: center; margin: 4px 0 0; }
    #modal:has(.schrow > button.schstrip.on:only-of-type) .mok { min-width: 160px; }
